Repository navigation
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close this PR in favor of the still-open canonical issue because the branch adds an HTTP-only in-flight snapshot path, while the remaining accepted work now needs a canonical gateway/history contract for the unpersisted active-run portion before any client adopts it. Canonical path: Keep the still-open canonical issue as the owner-boundary work item, design the gateway/history contract for the unpersisted active-run portion, then update Control UI and TUI against that single contract with real reconnect proof. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Keep the still-open canonical issue as the owner-boundary work item, design the gateway/history contract for the unpersisted active-run portion, then update Control UI and TUI against that single contract with real reconnect proof. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows the Control UI session switch clears local stream/run state, then reloads via JSON-RPC Is this the best way to solve the issue? No. This PR is an HTTP-only parity change and now conflicts with the maintainer-stated need for a canonical gateway/history contract that carries only the unpersisted active-run portion. Security review: Security review cleared: No dependency, workflow, permission, package, credential, or generated supply-chain surface changed; the blockers are functional contract and availability risks. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 7a7165ad22c4. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
chat.historymethod already surfacesinFlightRunfromchatAbortControllers/chatRunBuffers, but the HTTP/sessions/:sessionKey/history(REST + SSE) endpoint had no view into those maps.SessionHistoryInFlightRunResolverfromserver-runtime-state(which owns the run maps) throughcreateGatewayHttpServerintohandleSessionHistoryHttpRequest, and forward the resolved{ runId, text }snapshot in both the JSON body and the initial SSEhistoryevent.Real behavior proof
Behavior addressed: reconnect to a running session over the HTTP session-history endpoint now carries the active run's id and any buffered partial assistant text, letting the Control UI restore the in-progress response instead of falling back to the last committed user message.
Real environment tested: local vitest in worktree
Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/gateway/sessions-history-http.in-flight-run.test.ts && node scripts/run-vitest.mjs src/gateway/sessions-history-http.test.ts && node scripts/run-vitest.mjs src/gateway/sessions-history-http.revocation.test.ts && node scripts/run-vitest.mjs src/gateway/chat-abort.test.ts && node scripts/run-vitest.mjs src/gateway/server-runtime-state.test.tsEvidence after fix: new test file
src/gateway/sessions-history-http.in-flight-run.test.tspasses; existing sessions-history-http (16/16), revocation suite (12/12), chat-abort suite (108/108), and server-runtime-state (2/2) all stay green.Observed result after fix: SSE history event/JSON payload includes
inFlightRun: { runId, text }whenever the gateway runtime resolver reports an active run for the session key (canonical or requested), and remains absent when no active run is in flight.What was not tested: live multi-channel reconnect against a real running agent and Control UI client roundtrip.
Fixes #90755