Repository navigation
Description
What happened
A new worktree thread started with the message $implement Issue #140 ended up with the title title, and its branch stayed the temporary t3/<hash> placeholder (t3/ae699bd5) instead of being renamed. Nothing in the UI said anything had gone wrong. The user has seen the hash-named branch once before.
Diagnosis
The text generation model is Pi with zai/glm-5.3-flash (thinking low), set in textGenerationModelSelection. For this thread it gave bad structured output twice, and T3 Code handled the two cases differently:
-
Title: placeholder accepted as success.
PiTextGeneration.generateThreadTitleexited withSuccess, and thethread-title.generateoutbox effect issucceeded. Yet thethread.metadata-updatedevent at 08:18:24Z changed the title from$implement Issue #140totitle. The model evidently replied with a JSON object whosetitlevalue was literallytitle, probably echoing theReturn JSON with keys title and needsRefinementinstruction.decodeJsonReply(packages/provider-core/src/server/textGenerationOperations.ts) takes the first{...}thatextractJsonObjectfinds. It only checks thattitleis a string.sanitizeThreadTitle(textGenerationUtils.ts) only trims, strips quotes and truncates. So a title equal to the schema key, or another obvious placeholder, gets written over the user's seed title. -
Branch: failure only logged.
PiTextGeneration.generateBranchNamefailed withPi returned invalid structured output/SchemaError: Expected a valid JSON string.ThreadLaunchService.prepareInBackground(apps/server/src/orchestration-v2/ThreadLaunchService.ts) then keeps the temporaryt3/<hash>branch, logs a warning, and shows nothing in the UI.
In both cases, T3 Code never logs or traces the model's raw reply, so the bad output can't be inspected afterwards.
The same model failed the same way earlier that day: a generateThreadTitle call at 07:37:12Z failed with the same SchemaError, and a retry 8s later worked. Of 11 title and branch generations by this model in the trace window, 2 failed to parse and 1 returned the placeholder title.
Possible improvements:
- Treat a title that equals a schema key (
title,needsRefinement), or is otherwise a placeholder, as a failed generation, and keep the seed title. Optionally retry once. - Include a truncated copy of the raw model reply in the
TextGenerationErrorcause, or the trace span, when structured output doesn't parse. - Show a notice when branch-name generation fails, as [Bug]: Thread title and branch-name generation fail silently when the text generation provider is unhealthy #5359 asked for title generation, so a
t3/<hash>branch isn't silent.
Steps to reproduce
Not deterministic, because it depends on the model's output. The steps that hit it:
- Enable the Pi provider and set Settings → Text generation model to Pi /
zai/glm-5.3-flashwith thinkinglow. - Start a new thread in worktree mode with a short first message, e.g.
$implement Issue #140. - Sometimes the title becomes
title, and/or the branch stayst3/<hash>.
A deterministic way to see the title half: make a text-generation runner return {"title":"title","needsRefinement":false}, and generateThreadTitle returns title as a successful result.
Version
0.1.2-nightly.20261022.3512 (desktop app with the local server on the same machine; tag v0.1.2-nightly.20261022.3512). The triage CLI was 0.1.1-nightly.20261019.3373.
Environment
Linux x64 on WSL2 (kernel 6.18.54.1-microsoft-standard-WSL2), Node v26.8.2, pi 1.4.0, text generation model pi / zai/glm-5.3-flash (thinking low)
Evidence
# server.trace.ndjson: thread c2705bc8-0741-45c2-98e0-43574a6df378
2026-10-22T08:18:13.384Z PiTextGeneration.generateThreadTitle exit=Success (10976ms)
2026-10-22T08:18:14.358Z PiTextGeneration.generateBranchName exit=Failure (8071ms)
TextGenerationError: Text generation failed in generateBranchName: Pi returned invalid structured output.
at PiTextGeneration.runPiJson
at PiTextGeneration.generateBranchName
at ThreadLaunchService.generateBranchNameFor
at ThreadLaunchService.prepareInBackground
at ThreadLaunchService.schedulePreparation
[cause]: SchemaError: Expected a valid JSON string
# orchestration_events for the thread
08:18:13.337Z thread.created title="$implement Issue #140" branch=null
08:18:14.351Z thread.metadata-updated branch="t3/ae699bd5" (temporary worktree branch, never renamed)
08:18:24.361Z thread.metadata-updated title="title" (from generateThreadTitle, reported as success)
# orchestration_v2_effect_outbox
thread-title.generate status=succeeded attempt_count=1 last_error=null
# earlier the same day, same model
2026-10-22T07:37:12.037Z PiTextGeneration.generateThreadTitle Failure: Pi returned invalid structured output. SchemaError: Expected a valid JSON string
2026-10-22T07:37:20.864Z PiTextGeneration.generateThreadTitle SuccessRelated issues
#5359 (closed) covered title and branch generation failing silently when the text generation provider is unhealthy. Here the provider is healthy and returns bad output: once as a hard parse failure (branch, still silent), and once as a placeholder title that is accepted as success. #19053 (closed) is a different Pi text generation failure, about models added by Pi extensions.
Fix applied or workaround
Nothing was changed on the machine. Workaround: regenerate or rename the title and branch by hand, or choose a more reliable text generation model (or higher thinking).
Filed by
Claude Code (claude-opus-5-5) via t3 triage
Activity