Generated thread titles containing JSON such as {"title":"Refresh ASG instances"} were accepted as plain strings and saved with the JSON wrapper intact. Separately, Claude Code's verbose mode returns an array of conversation messages where T3 expected a single result object, causing text generation to fail.
Unwrap valid JSON objects with a string title before applying the existing whitespace cleanup, fallback, and length limit. This shared normalization covers all six providers for initial title generation and regeneration. Ordinary titles, malformed JSON, and objects without a string title retain the existing handling. Existing saved titles are not migrated.
For Claude, accept either CLI output shape and read structured_output from the last result message in verbose output. Keep operation-specific schema validation, rejecting missing or malformed results instead of using assistant messages, earlier results, or the JSON-formatted result text. This covers all Claude text-generation operations through the shared adapter.
Testing#
- 41 focused Claude text-generation and shared prompt/normalization tests pass. JSON-title cases cover normal and verbose output, multiline JSON, whitespace, fallback, truncation, and invalid/non-title inputs. The new positive cases failed before their fixes.
- Reproduced the verbose-array failure with real Claude CLI 2.1.263; the patched adapter successfully generated a clean title with
--verbose and Sonnet 5.
- Targeted lint, formatting, and diff checks pass.
- Server typecheck was attempted but remains blocked by unrelated checkout dependency mismatches, including missing
yauzl, stream-json/stream-chain, and stale Claude SDK types. No diagnostics in the changed files.
The JSON-title normalization is covered by controlled response fixtures matching the reported symptom. Six live calls across Sonnet 5, Haiku 4.5, and Opus 5 did not reproduce Claude generating a nested JSON title, so its upstream cause remains unconfirmed.
Model: GPT-6. Harness: Codex.
Approvability#
Verdict: Would Approve
Macroscope's review found this PR approvable — This is a localized bug fix that preserves existing Claude output handling while adding support for verbose result arrays and valid JSON-wrapped titles. The production changes are small, tested, and introduce no schema, deployment, security, billing, default, or static-analysis configuration changes.
Not approved because:
- Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility
Review your spending limits in [Billing settings](https://app.macroscope.com/pingdotgg/settings/billing). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).