Repository navigation
fix(verify-mcode): read live turn events from agent.canonical - #1805
Merged
Merged
Conversation
Since #1779 the server publishes live turn events only on the agent.canonical push channel. The runtime live harness and the composer-queue proof still listened for agent.event, so every runtime live scenario timed out waiting for a terminal event even when the assistant reply was saved. canonicalFrameToLiveEvents reads the publication.recorded payloads of accepted, saved, and recovery frames and applies the web client's publication route. Callers record each event ID once because saved and recovery frames repeat accepted events. A stopped turn now publishes only ended with an interrupted outcome, so ended counts as completion only with a completed outcome and counts as a stop otherwise.
…me restart agent:up returns after it writes ports.json, before the server answers health. The resume proof called health with a 15-second budget right after agent:up and failed when startup took longer. On a loaded host the server took up to 15.9 seconds to open its listener, Vite once took 19.9 seconds, and one restart also failed the agent:ready CLI's fixed 30-second budget. Call agentReady in-process, bounded by the proof deadline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Since #1779 the server publishes live turn events only on
agent.canonical. Theruntime liveharness and the composer-queue proof still listened foragent.event, so every live scenario timed out with "No terminal provider event arrived" even when the reply was saved.The harness now reads the
publication.recordedpayloads of accepted, saved, and recovery frames throughcanonicalFrameToLiveEvents. It applies the web client's publication route and records each event ID once, because saved and recovery frames repeat accepted events. A stopped turn now publishes onlyendedwith outcomeinterrupted. Soendedcounts as completion only with a completed outcome, and counts as a stop otherwise.A second commit fixes the OpenCode resume restart. It called health 15 seconds after
agent:up, which returns before the server is ready. It now waits withagentReady, bounded by the proof deadline.Verified on a live worktree runtime:
opencode-resumewithopencode/muse-spark-1.3-contributor-free:ok: true, every resume field true,sdk_session_invalidatedseen after the restart.subagentwith Codexgpt-5.6-terraon the fixture repo:ok: true,terminalEvent: turnComplete.completionwith Claudeclaude-haiku-4-5:ok: true,terminalEvent: turnComplete.node --test runtime.test.mjs: 14 pass.bun test composer-queue.test.mjs: 58 pass. All test frames parse underCanonicalAgentProgressFrameSchema.Why
Agents use
runtime liveto prove provider changes. With every scenario failing for every provider, the harness could not prove anything.Review Notes
stopstill fails, at a different step. Both concurrentagent.stopcalls now returnstatus: cancelled.hasSharedStopResultexpects onecancelledand onealready-terminalpeer, and it compares results by reference. The push side of stop now works:turnStartedarrives andended=interruptedis recorded. I left the stop contract alone because I could not tell whether the server or the harness holds the intended behavior.thread.statusproduced no pushes for a completed or a stopped Claude turn on this runtime. The harness still reads it, but stop detection no longer depends on it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.