Skip to content

Let Claude text generation read past a workspace launcher's banner - #213

Merged
henrychu04 merged 1 commit into
coder-onlyfrom
t3code/claude-textgen-launcher-banner
Oct 19, 2026
Merged

henrychu04 merged 1 commit into
coder-onlyfrom
t3code/claude-textgen-launcher-banner

Conversation

@henrychu04

Copy link
Copy Markdown
Owner

Problem

At work, Claude thread titles never generate. The workspace's claude is a managed startup script. In -p mode it prints === Claude Startup Script ===, a policy notice, an authentication check, === Launching Claude === and a tip on stdout, then runs the CLI. It shows no "Press Enter" prompt when stdin is piped, which was checked with echo hello | claude -p in the workspace.

ClaudeTextGeneration.ts decodes all of stdout as one JSON value, so every run fails with "Claude CLI returned unexpected output format." Titles swallow that error and keep the seed title. Review guides go through the same runner, which likely explains their "unexpected output format" report.

Change

  • withoutLauncherPreamble drops plain-text lines before the first line that starts with { or [. It applies both to the success decode and to claudeErrorResult on a failed run. This matches what Drivers/ClaudeCli.ts already does for stream-json (096bf07).
  • The change is marked Coder: and listed in the text-generation seam in docs/internals/coder-only.md.

Verification

  • With a fake CLI printing the work banner before the JSON, scratch tests for the success and error paths failed without the fix and passed with it. The scratch tests are not committed.
  • vp test run src/textGeneration: 52 passed.
  • pnpm typecheck:server and vp fmt --check pass.
  • Locally, the real Claude CLI (2.1.303) still generates titles.
  • Still to do: a live title check at work once the helper is updated.

🤖 Generated with Claude Code

The work workspace's `claude` is a managed startup script that prints a
banner, an authentication check, and a launch line on stdout before the
CLI's JSON. Text generation decoded all of stdout as JSON, so every
Claude thread title (and review guide) failed with "unexpected output
format", silently for titles. Drop plain-text lines before the first
JSON line, as Drivers/ClaudeCli.ts already does for stream-json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@henrychu04
henrychu04 merged commit 1984942 into coder-only Oct 19, 2026
@henrychu04
henrychu04 deleted the t3code/claude-textgen-launcher-banner branch October 19, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant