Conversation
|
@mohakchakraborty2004 friendly nudge: if there's an issue this addresses, please link it (Fixes #N). If none exists, no action needed. |
|
Relay review: migrations, telemetry, and one production blocker Migrations: none. Telemetry: too loud on the hot path. Three INFO lines per output frame (
Single-replica is a production blocker, not a testing one. The live fan-out is in-process ( Mitigation (pick one):
Test the mitigation before pushing it:
Net: fine to keep deployed and merged behind its flag at count=1. Hold multi-replica until the cross-replica path lands and passes the test above. |
Fixes #5350's IssueTerminalTicket exit-detection: it flagged the agent 'exited' whenever ANY agent terminal was closed/failed, but every resume closes the old terminal and opens a new one, so a resumed session was always mis-reported as exited (410) even with a live open terminal. Now only exits when a dead terminal exists AND no live one does. Belongs to #5350's lineage (main), parked here so the combined deploy carries it; should become a standalone main fix.
Resolve the one conflict in cloud-terminal-mux.ts (+ its test) toward #5329's state-driven attach. main (#5350 relay) still carries the agent-ready SSE wait / upgradeToAgent path that #5329 deliberately removed; both sides already have the 410 TERMINAL_SESSION_EXITED handling so that converges. The renderer callers use none of the dropped options (only the test did), so taking #5329's mux + test keeps the tree consistent. #5350's relay is CP/worker-side and merged cleanly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve the one conflict in backend/internal/service/agent/codex_accounts_test.go toward main: main hardened this test (shared-call wait + TempDir-race fix, the 'shared' rename) and this branch carried the older version. The branch's actual change — the false-410 exit-detection narrowing in worker_transport_store.go — auto-merged cleanly on top of #5350's relay (both AND NOT EXISTS(opening/open) blocks intact). Taking main's test also fixes the flaky TestAuthenticationRequestCancellationDoesNotCancelSharedRead CI failure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Implement the Docker-local version of the cloud terminal relay architecture.
Terminal traffic now uses a live relay path between the Electron client and the worker’s outbound terminal stream, while preserving an asynchronous durable mirror in the control plane/Postgres. The change also distinguishes an exited coding-agent terminal from a worker that is still provisioning.
Why
The existing cloud terminal path made the control plane’s durable transport the synchronous data path for every keystroke and output frame. This added avoidable latency and made terminal responsiveness dependent on the queued transport path.
It also treated an exited agent terminal the same as a cold worker. The UI therefore retried indefinitely on an old/exited session and remained stuck on “Connecting…”.
How
410 TERMINAL_SESSION_EXITEDfor an agent terminal that has already finished, rather than returning retryable worker-unavailable state.409 WORKER_UNAVAILABLE).agent.readygrace period so sessions that already exited cannot wait forever for an event that will never arrive.Testing
Validated locally:
cd frontend npm run typecheck npx vitest run src/renderer/lib/cloud-terminal-mux.test.ts src/renderer/components/TerminalPane.test.tsxAlso verified manually with the Docker-local cloud stack:
Then launch Electron against the local control plane:
cd frontend AO_CLOUD_OFFERING=on \ AO_CLOUD_CONTROL_PLANE_URL=http://127.0.0.1:8081 \ npm run devObserved behavior:
410and stops retrying instead of staying on “Connecting…”.Checklist
main(or continuing an existing PR branch)go, frontend, etc.)