Repository navigation
Let Claude text generation read past a workspace launcher's banner - #213
Merged
Merged
Conversation
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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
At work, Claude thread titles never generate. The workspace's
claudeis a managed startup script. In-pmode 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 withecho hello | claude -pin the workspace.ClaudeTextGeneration.tsdecodes 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
withoutLauncherPreambledrops plain-text lines before the first line that starts with{or[. It applies both to the success decode and toclaudeErrorResulton a failed run. This matches whatDrivers/ClaudeCli.tsalready does for stream-json (096bf07).Coder:and listed in the text-generation seam indocs/internals/coder-only.md.Verification
vp test run src/textGeneration: 52 passed.pnpm typecheck:serverandvp fmt --checkpass.🤖 Generated with Claude Code