Repository navigation
fix(harness): record a stop before interrupting, derive recovery in the drain - #150
Merged
Merged
Conversation
…he drain A user stop on an open run now publishes session.execution.stopping before anything is interrupted, so a host killed while the stop winds down ends the run as stopped instead of resuming it as a crash. A shutdown that reaches a run already asked to stop ends it as the user's stop too. Recovery of a run the host cut off is decided by the drain from the thread row, whichever wake reaches it first: a prompt that gets there before startup recovery no longer leaves the restart uncounted. resumeUnfinished only wakes. Every run terminal is published by the executor, joined to the run's last step, and a run whose execution.started cannot be published does not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The thinking test ignores durable llm.progress events, and the retry test expects the mid-stream attempt to keep what streamed. The retry proxy cuts at the first delta that carries text, not at a role-only delta. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A thread whose open run carries the user's stop reads as stopping in every window and after a reload. The real-machine recovery tests record the new event and expect a parked follow-up and the next steer to go in together. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A thread summary carries `parked`: idle, nothing owed a run, and a prompt pending. It is derived from the head and tail positions on every read, so clients get the fact without the positions. A change to what is pending carries the thread's revision forward, so a client that follows by revision reads the thread again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The app server mirrors a thread's `parked`, and the session queue reads "Parked · Runs with your next message" while it holds. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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 changes
session.execution.stoppingbefore anything is interrupted. The startup sweep ends a marked run asexecution.interrupted { user }instead ofcrash, so a host killed while a stop winds down no longer resumes the stopped run. A shutdown that reaches a run already asked to stop ends it as the user's stop too.resumeUnfinishedonly wakes;recover/abandonand three in-memory sets are gone.execution.startedcannot be published does not run.parkedon a thread summary. Idle, nothing owed a run, and a prompt pending, derived from the head and tail positions on every read. A change to what is pending carries the thread's revision forward so revision-based sync picks it up.parked, and the queue reads "Parked · Runs with your next message".Wire and schema
session.execution.stopping. The four run terminals keep their types.parkedon the thread summary.thread.parkedcolumn. No harness schema change.Verification
vp checkandvp run typecheckpass.recovery.stop-killedfailed before the change.Known
apps/serversync.test.ts"a restart … resumes from the cursor" fails oncanarybefore this change too.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.