Gotchas while using AO #351
harshitsinghbhandari
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A running list of non-obvious gotchas hit while using AO (the
aodaemon + CLI + spawned agent workers), with the root cause and the fix for each. Reply with your own and I'll fold them in.1. Spawned workers come up
Not logged inwhen the daemon was started from inside a Claude Code sessionSymptom
A worker spawned with
ao spawn ... --agent claude-code(the default agent) boots into its zellij pane but the Claude Code TUI shows:The task never starts because the agent has no auth, even though running
claudeyourself in a normal terminal works fine.Root cause
Auth flows from the daemon's environment down to every worker:
CLAUDE_CODE_OAUTH_TOKENexported, which is why aclaudeyou launch yourself is authenticated.CLAUDE_CODE_OAUTH_TOKEN(and similar secrets) from the environment it hands to its own Bash tool, for security. So the token is invisible to anything Claude Code runs as a subprocess.ao startfor you, the daemon inherits that scrubbed, tokenless environment.os.Environ()(backend/internal/adapters/runtime/zellij/zellij.go), so each worker inherits the tokenless env and comes up logged out.It is not a build, daemon, or AO bug. The daemon simply cannot pass along a token it never received.
How to confirm it:
Fix
Always start the daemon from your own terminal, where the token is exported. Do not let Claude Code start it for you (a
! ao starttyped into the Claude Code prompt is also run through the scrubbed shell, so that does not work either).Once the daemon holds the token,
spawn/kill/statuscan be driven from anywhere, including from inside a Claude Code session, because the CLI is a thin client and the daemon (not the CLI) is what spawns workers and supplies their environment.The same applies to the API-key path: if you authenticate workers with
ANTHROPIC_API_KEYinstead of OAuth, that variable must be present in the daemon's environment atao starttime, so export it in the terminal you start the daemon from.Beta Was this translation helpful? Give feedback.
All reactions