Repository navigation
fix: Route headless Claude prompts before launch under smart routing - #1096
Draft
max-rozen-oss-db wants to merge 1 commit into
Draft
max-rozen-oss-db wants to merge 1 commit into
max-rozen-oss-db wants to merge 1 commit into
Conversation
With first-prompt routing on, ug always ran Claude inside its PTY router. In print mode the PTY swallowed the piped prompt, so `ug claude -- -p` exited with "Input must be provided". Print mode now takes the prompt from the -p argument, the args after --, or stdin, routes it, pins the model, and launches Claude directly. Subagent routing stays on. This also gives Windows headless launches first-prompt routing. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Summary
Stacked on #1074.
With smart routing on,
ug claude -- -plost its prompt on Linux and macOS. ug always launched Claude inside its PTY first-prompt router. In print mode the PTY swallowed the piped prompt, and Claude exited with "Input must be provided either through stdin or as a prompt argument when using --print". Terminal Bench found it: every Claude task failed on Linux with routing on, in run 38002405792.v2.launch_claudenow handles print mode (-p/--print) without the PTY:--, the argument right after-p, or piped stdin._route_claude_prompt, pins the model with--model, and launches Claude directly. When ug read stdin, it writes the same bytes to Claude's stdin.--modelor a ug-pinned model skips routing. A router failure prints a warning and launches on Claude's default.Windows headless launches now get first-prompt routing too, since this path doesn't need the PTY. Interactive launches are unchanged.
Verification
TestV2HeadlessClaudetests cover a stdin prompt, a prompt argument, an explicit--model, and a router failure.just lintpasses. The unit suite has the same 13 local failures with and without this change. They need local sockets or network, and CI runs them.This pull request and its description were written by the Isaac LLM tool (Claude Code, session
35c1ab71-d945-4de6-97b9-b35d5758edb4).