Repository navigation
fix(tool): coi tool spec feeds claude the prompt on stdin, codex after -- - #1188
Merged
Merged
Conversation
…r -- A prompt starting with "-" was parsed as tool options, and one of 128 KiB or more failed with "Argument list too long". Interactive codex refuses a non-terminal stdin, so a codex prompt too large for one argument comes back out-of-band in the spec's prompt field.
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.
Redmine: 56901
coi tool spec(interactive launch, no print mode) still passed the prompt to claude and codex as a positional"$(cat <file>)", so a prompt starting with-(front matter---, a list item-,--version) was parsed as tool options, and one of 128 KiB or more failed withArgument list too long. #1181 fixed this for thecoi run --prompt(print-mode) path only.<file. Interactive Claude Code reads a redirected stdin as the first message and then opens the terminal for the session. Checked with Claude Code 2.1.335 in tmux: a 200 KB prompt starting with--versionarrived byte-exact in the transcript (200029 chars) and typed keys still reach the input box. No piped-input join here: the orchestrator's stdin is the terminal.Error: stdin is not a terminal, codex-cli 0.173.0), so the prompt stays a positional, now after--(clap:codex -- --versionopens the TUI instead of printing the version; alsocodex resume <id>|--last ... -- <prompt>). A prompt larger than one argument can hold (131071 bytes) can't go in the command at all:BuildCommandLaunchreturnstool.ErrPromptOutOfBand, and the spec comes back without it and with the staged path in the existingpromptfield, as for opencode, for the orchestrator to deliver after launch.coi tool specnow passes the staged prompt's size inLaunchSpec.PromptSize. Help text updated.Tests
internal/tool/launch_test.go: runs the rendered command throughbash -cwith a stub tool binary. Claude interactive:--version,- fix ..., front matter and 200 KiB arrive byte-exact on stdin, no prompt in argv. Codex: the dash prompts arrive as the argument after--for a fresh launch,resume <id>andresume --last; a 131071-byte prompt runs, 131072 fails the exec withArgument list too long, and a largerPromptSizereturnsErrPromptOutOfBand. These fail onmaster.internal/cli/tool_spec_test.go: a 200 KiB codex prompt comes back out-of-band with no prompt in the command; claude/codex assertions updated.tests/config/test_tool_spec.py: assertions updated (<filefor claude,-- "$(cat …)"for codex); the codex test also stages a 200 KiB prompt and expects thepromptfield. Needs Incus: not run locally, CI only.Local:
go test -short -race ./...,go vet,gofmt,golangci-lint(0 issues),ruff check/ruff format --check.Performance impact
none (launch-command construction, once per orchestrator launch; not a hot path).