Agent stays "online" after its Claude credentials expire — every mention fails with -32000, nothing surfaces it
I'm running three agents headless in Docker on a VPS (buzz 0.5.0 binaries from the Linux .deb, buzz-acp spawning claude-agent-acp 0.63.0, hosted relay). Two of them use Claude Code with a subscription login. Both died about a day after I signed them in, and I had no way of knowing.
Bumble was signed in around 01:10 UTC on 29 July. First failure 06:31 on 30 July — roughly 29 hours later. Fizz was signed in ~01:24 on the 29th, first failure 20:14 on the 30th, so about 43 hours. Since then every single mention fails:
ERROR pool::prompt: session_prompt error: Agent reported error (code -32000): Authentication required
WARN buzz_acp: agent_returned (application error — pipe intact) agent=0 outcome="error"
Running claude auth status inside the container confirms it:
{"loggedIn": false, "authMethod": "none", "apiProvider": "firstParty"}
The credentials went stale and there's no browser in the container to complete a refresh, which I understand. That part is my problem for running it headless.
The part I think is a bug is that nothing shows this. The container is Up, the harness stays connected to the relay, and presence set to online never changes. In the client the agent looks completely normal. Fizz sat dead for hours while showing online, and I only found out because I happened to check the logs of a third agent that was working.
Presence seems to reflect the harness's websocket, not whether the agent can actually do anything. When session_prompt returns Authentication required on every turn, the agent isn't online in any sense the user cares about.
A few things would each have saved me the confusion, in rough order of how useful they'd have been:
- Presence going away or changing after N consecutive
outcome="error"turns - The harness posting something into the channel when it can't authenticate, so the failure appears where you're already looking
- A non-zero exit or an unhealthy signal so Docker/systemd notices, rather than staying up in a broken state
Worth noting the third agent, running goose against an API key instead of a subscription login, has zero auth errors over the same period. So this is specific to credential types that expire and need an interactive refresh.
Possibly related: #2265 — same shape (Claude agent silently stops working), different cause.
Claiming this. Deterministic gap: is_auth_error() (crates/buzz-acp/src/lib.rs) matches Re-authenticate and API Error: 401 (PR #2751) but not your exact message Authentication required (code -32000) — so the immediate dead-letter + in-channel re-auth notice never fires for your build; every mention fails silently or burns ~10 retries until dead-letter. Preparing a narrow fix (extend auth-classification to cover that variant) with a fail-first test.
Fix up: PR #3881 — extends is_auth_error() to cover the exact message variant you hit (Authentication required, -32000), so the immediate dead-letter + in-channel re-auth notice now fires instead of silently burning ~10 retries. Fail-first test included. Presence/offline-after-N-errors (your option A) left as a follow-up.
Fresh macOS evidence from m4 (2026-09-15): after Claude credentials were refreshed on disk, the long-lived buzz-acp children still returned Agent reported error ... OAuth session expired and could not be refreshed on every mention. Relaunching Buzz restarted the harnesses, but the Desktop readiness gate spawned all Claude agents in setup-listener mode because its claude auth status probe reported not-ready at spawn; no normal agent_pool_ready followed. Source confirms the failure surface: desktop/src-tauri/src/managed_agents/readiness/cli_login.rs runs claude auth status, while crates/buzz-acp/src/acp.rs spawns claude-agent-acp as a separate child and AcpClient::spawn only inherits the environment at child start. The live child logs show repeated agent_returned (application error — pipe intact) and the harness keeps presence online. The cheapest durable detection is the existing agent_returned outcome="error" stream plus a consecutive-auth-error health threshold / visible failure notice; this incident remains silent at the presence layer.