Skip to content

fix(autocoder): stop the manager dying on the bypass-permissions dialog - #136

Merged
laird merged 1 commit into
masterfrom
fix/manager-launch-consent-race
Aug 31, 2026
Merged

fix(autocoder): stop the manager dying on the bypass-permissions dialog#136
laird merged 1 commit into
masterfrom
fix/manager-launch-consent-race

Conversation

@laird

@laird laird commented Aug 31, 2026

Copy link
Copy Markdown
Owner

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:

claude --dangerously-skip-permissions --model claude-opus-5

  WARNING: Claude Code running in Bypass Permissions mode
  ❯ No, exit
    Yes, I accept

kink-party main ? ✗

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, where claude-worker-loop.sh starts Claude itself, so no send-keys ever races a TUI — which is why workers were unaffected and this looked intermittent.

The manager's prompt was sent after a fixed sleep 5 with no readiness check. --dangerously-skip-permissions opens 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). In argv mode the prompt is appended to MANAGER_LAUNCH_CMD via printf %q and the post-launch send-keys is dropped entirely — no stray Enter, so the dialog waits for a real keypress and the prompt runs once accepted.

Agent Mode Behavior
claude argv changed
gemini agent-input unchanged
codex (goals branch) agent-input unchanged
codex (fallback), droid shell unchanged

Applied 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.
  • Dry-run of the composed command: claude --dangerously-skip-permissions --model claude-opus-5 /autocoder:monitor-loop
  • bash -n clean on both files.

🤖 Generated with Claude Code

https://claude.ai/code/session_011JjWeRTcWvmuUPKRDvveEG

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
@laird
laird merged commit 10fe0dd into master Aug 31, 2026
4 checks passed
@laird
laird deleted the fix/manager-launch-consent-race branch August 31, 2026 16:19
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