fix(autocoder): stop the manager dying on the bypass-permissions dialog - #136
Merged
Conversation
The manager is the only claude path that launches a REPL and then types its prompt into it: workers use WORKER_LAUNCH_MODE=shell, where claude-worker-loop.sh starts Claude itself and no send-keys ever races a TUI. That typed prompt was sent after a fixed `sleep 5`, with no check that Claude was ready. `claude --dangerously-skip-permissions` opens a consent dialog whose default selection is "No, exit", so the trailing Enter answered the dialog instead of submitting the prompt. Claude exited and the review window was left at a bare shell, which reads as an unrelated login session rather than a failed manager. Add MANAGER_COMMAND_MODE (argv|agent-input|shell). In argv mode the prompt is appended to MANAGER_LAUNCH_CMD via printf %q and the post-launch send-keys is dropped entirely, so there is no stray Enter: the dialog waits for a real keypress and the prompt runs once accepted. claude uses argv; gemini and the codex-goals branch stay on the typed path; codex-fallback and droid stay shell. Both the tmux and cmux launch sites branch on it. Verified `claude -p "/help"` reports "/help isn't available in this environment", i.e. a slash command passed as argv is parsed as a slash command rather than as literal prompt text. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JjWeRTcWvmuUPKRDvveEG
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
The parallel-agent manager silently fails to start under
--agent claude. Its tmux window is left at a bare shell in the project root, which reads as an unrelated login session rather than a failed manager.Observed scrollback:
Cause
The manager is the only claude path that launches a REPL and then types its prompt into it. Workers use
WORKER_LAUNCH_MODE=shell, whereclaude-worker-loop.shstarts Claude itself, so nosend-keysever races a TUI — which is why workers were unaffected and this looked intermittent.The manager's prompt was sent after a fixed
sleep 5with no readiness check.--dangerously-skip-permissionsopens a consent dialog defaulting to No, exit, so the trailing Enter answered the dialog instead of submitting the prompt.Fix
New
MANAGER_COMMAND_MODE(argv|agent-input|shell). Inargvmode the prompt is appended toMANAGER_LAUNCH_CMDviaprintf %qand the post-launchsend-keysis dropped entirely — no stray Enter, so the dialog waits for a real keypress and the prompt runs once accepted.argvagent-inputagent-inputshellApplied at both the tmux and cmux manager launch sites.
Verification
claude -p "/help"returns "/help isn't available in this environment" — confirming a slash command passed as argv is parsed as a slash command, not literal prompt text.claude --dangerously-skip-permissions --model claude-opus-5 /autocoder:monitor-loopbash -nclean on both files.🤖 Generated with Claude Code
https://claude.ai/code/session_011JjWeRTcWvmuUPKRDvveEG