Repository navigation
feat(sessions): continue runs interrupted by a restart in pi-durable - #185
Merged
Merged
Conversation
A Slack run or task cut off by a deploy or crash now continues its own turn after the restart instead of being aborted. The Slack platform declares continuesInterruptedRuns, so shutdown neither waits for nor aborts its runs. Before the socket connects, the bot asks SessionStore.continueInterrupted for each channel: an office written in the last 24 hours opens without aborting, keeps the interrupted runs of indexed sessions, aborts the rest, and calls harness.resume() only after every kept session is bound; other submissions in the office wait, and a session unbound after 60 s is aborted. The system prompt tells the model what an interrupted tool result means. The task resume prompt and its two-resume cap are removed (ADR 0027 supersedes ADR 0021 decisions 5-7).
Deploying mikan with
|
| Latest commit: |
4689bec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5798eaf1.mikan-1wv.pages.dev |
| Branch Preview URL: | https://feat-native-run-continuation.mikan-1wv.pages.dev |
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.
Why
A deploy or crash during an agent run aborts it: the Slack progress message stays at its last step and nobody answers. Only tasks recovered, by aborting and starting a new run with a resume prompt, at most twice. Runs are getting longer (hours for the planned GitHub agent and long tasks), so this would drop work on most deploys. pi-durable already keeps interrupted work pending across a crash or
close()and continues it withharness.resume(), as Pi's own hosts do; mikan turned that off.What (ADR 0027)
MessagingInfo.continuesInterruptedRuns: Slack sets it, so shutdown neither waits for nor aborts Slack runs (deploys stop in about 1 s). Other platforms keep the 5-minute drain.SessionStore.continueInterrupted(office): for an office written in the last 24 h, opens storage without aborting, keeps the interrupted runs of indexed sessions, aborts the rest, and callsharness.resume()only once every kept session is bound (continueInterruptedRun). Other submissions in that office wait (whenContinued); a session still unbound after 60 s is aborted instead of failing silently.continuedRunId(sessionKey)run, whichMikanAgentSession.continueInterrupted()drives without submitting input or syncing chat history.RESUMED_TASK_PROMPT,claimResume,interruptedSince, the resume cap and its message. ADR 0021 decisions 5–7 are marked superseded.Evidence
pi-durable 1.2, real model,
sleep 20; date +%sinterrupted 2 s in, 5 trials each:Local daemon on a test Slack workspace,
sleep 90; date +%s, daemon stopped mid-command:SIGKILLSIGTERMSIGKILLKnown limits
Verification