fix(frontend): surface daemon failure reason instead of generic "not ready" error#2584
fix(frontend): surface daemon failure reason instead of generic "not ready" error#2584xOAviOx wants to merge 1 commit into
Conversation
…ready" error When the supervisor cannot attach to a daemon (checkout identity mismatch, spawn failure, unexpected exit), the main process computes a specific diagnostic and sends it over the daemon:status IPC - but the renderer dropped it: applyDaemonStatus only quarantined the base URL, and the api-client's 503 short-circuit always answered with the generic "AO daemon is not ready." Keep the status message alongside the quarantined base URL so surfaced API errors name the actual cause and remedy instead of masking them. Fixes AgentWrapper#2481
|
Thanks for contributing to Agent Orchestrator. This PR is being picked up by the current external contributor on-call pair: If someone is already working on this, please continue as usual. You are also welcome to join the AO Discord community. We do daily Discord calls at 10 PM IST, except Saturday. Join the session here: Come by if you want to see what is being built, ask questions, or just hang around with the community. |
Bug
When a second checkout's Electron instance cannot attach to the daemon (checkout identity mismatch — but also spawn failure or unexpected exit), the main process computes a specific, actionable diagnostic and sends it over the
daemon:statusIPC. The renderer drops it: every API call surfaces only the generic"AO daemon is not ready."error, so the user never learns another checkout owns the daemon or how to fix it.Root cause
applyDaemonStatus()(renderer/lib/daemon-status.ts) quarantines the base URL for non-ready statuses but discardsstatus.message.runtimeFetch()'s 503 short-circuit (renderer/lib/api-client.ts) hardcodes the generic body, soapiErrorMessage()can only ever surface the fallback.The diagnostic is computed in
main.ts(daemonIdentityError()), shipped over IPC, and then dead on arrival.Fix
Keep the status message alongside the quarantined base URL (
setDaemonUnavailableMessage), and let the 503 short-circuit prefer it over the generic fallback — the samestatus.message || "AO daemon is not ready."pattern_shell.tsxalready uses for project creation. This benefits everydaemonStatusfailure path (identity mismatch, spawn failure, daemon exit), not just the issue's trigger, and complements #2253 (which disables actions and adds a Restart button but does not fix the message masking).Testing
renderer/lib/daemon-status.test.tsregression test: fails before the fix (generic message masks the identity diagnostic), passes after. Also covers the no-message fallback and that a stale reason is cleared once the daemon is ready again.useDaemonStatus.test.tsx: completed the partialapi-clientmock with the new export.tsc --noEmit, andprettier --checkon the changed files all pass.Fixes #2481