From 1cf11b6d9f1968abd3a427484d503aaeedca39eb Mon Sep 17 00:00:00 2001 From: Sujay Choubey Date: Tue, 17 Feb 2026 18:40:42 +0530 Subject: [PATCH] fix: include agentConfig.permissions=skip in ao init --auto output When using claude-code, each agent runs inside a fresh git worktree it has never previously visited. Claude shows an interactive trust prompt on first entry to any new directory and blocks waiting for a keypress. Without --dangerously-skip-permissions, every spawned agent silently hangs at this prompt. The dashboard shows all sessions stuck at "spawning" indefinitely and no work is ever performed. Root cause: handleAutoMode() in init.ts built the config object without the agentConfig.permissions field, so the claude-code plugin defaulted to "default" (no flag) on every spawn. Fix: - Add agentConfig.permissions: "skip" to the defaults block emitted by ao init --auto, with an inline comment explaining why it is required - Update README Configuration example to show the field and explain the trust-dialog failure mode - Add the scenario to the Troubleshooting quick-reference so users who hit it after manual config edits can find the fix immediately The fix is safe: AO creates worktrees from the user's own repository, so the implicit trust granted by --dangerously-skip-permissions is equivalent to the user manually accepting the prompt for every session. Co-Authored-By: Claude Sonnet 4.5 --- README.md | 13 +++++++++++++ packages/cli/src/commands/init.ts | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 2b249fa64..df2a0a6bd 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,8 @@ defaults: agent: claude-code workspace: worktree notifiers: [desktop] + agentConfig: + permissions: skip # required — see note below projects: my-app: @@ -170,6 +172,16 @@ projects: Write clear commit messages. ``` +> **`permissions: skip` is required when using claude-code.** +> Each agent runs in a fresh git worktree it has never seen before. Claude shows +> an interactive trust prompt on first entry to any new directory — *"Do you trust +> the files in this folder?"* — and waits for a keypress. Without this flag, every +> spawned session silently blocks at that prompt, the dashboard shows all agents +> stuck at "spawning", and no work ever gets done. Setting `permissions: skip` +> passes `--dangerously-skip-permissions` to Claude, bypassing the prompt. +> This is safe in the AO context because you are the one creating the worktrees +> from your own repository. + See `agent-orchestrator.yaml.example` for full reference. ## Examples @@ -213,6 +225,7 @@ See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues and solutions. - Terminal not working → node-pty rebuild (automatic via postinstall hook) - Port in use → Kill existing server or change port in config - Config not found → Run `ao init` from your project directory +- **All agents stuck at "spawning" forever** → `agentConfig.permissions: skip` is missing from your config. Claude blocks on an interactive trust dialog in each new worktree. Add it under `defaults:` (see Configuration above). ## Philosophy diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 92c5fac80..7f9a73fea 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -441,6 +441,14 @@ async function handleAutoMode(outputPath: string, smart: boolean): Promise agent: "claude-code", workspace: "worktree", notifiers: ["desktop"], + // Required for claude-code: each agent runs in a fresh git worktree it has + // never seen before. Claude shows an interactive trust dialog on first entry + // to any new directory. Without this flag the agent process blocks silently + // waiting for keyboard input that never arrives, causing every spawned + // session to hang at "spawning" indefinitely. + agentConfig: { + permissions: "skip", + }, }, projects: { [projectId]: {