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 <noreply@anthropic.com>
This commit is contained in:
Sujay Choubey 2026-02-17 18:40:42 +05:30
parent 5fe476774d
commit 1cf11b6d9f
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -441,6 +441,14 @@ async function handleAutoMode(outputPath: string, smart: boolean): Promise<void>
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]: {