You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A turn that finished while the plugin was not listening is replayed as interrupted #727
resume.js notes every running Bot turn in inflight.json and picks up what is still noted at the next start. It decides "cut off" from the first turn/start/turn/endthis process sees. Events a reloaded plugin missed are not replayed, so when a turn finished while the plugin was not listening (a plugin reload, or a crash right after DSH appended turn/end but before the note was cleared), the note remains, the Agent is idle, and the turn is resumed as "DeepSeek Harness restarted while you were working". The Bot repeats already-finished work, possibly with repeated side effects.
Expected
Resume only a turn the restart really cut. The durable Session log says: interrupted, an abort caused by disposed, or no end = cut; completed / blocked / max-tokens / forked / aborted by the user, hook or parent = finished (do not repeat). A turn/start seen after the start also means the noted turn ended.
Change scope
core/src/host/resume.js (record the turn number, check the durable end, keep the note on interrupted), core/test/follow-through.test.js, docs/subsystems/core-host.md.
Promoted to agent-ready (Triage, 2026-10-22): the expected behaviour in the body already decides the hard part, so acceptance is writable.
Acceptance, in code:
core/src/host/resume.js records enough identity with each note in inflight.json to ask the durable session log what became of that turn, and clears the note only on the paths that really did finish.
The classification is exactly the one in the body: interrupted, an abort caused by disposed, or no end at all → resume. completed, blocked, max-tokens, forked, and an abort by the user, a hook or the parent → do not resume, and the note is cleared.
A turn/start for that turn seen after the plugin's start also means the noted turn ended — do not resume it twice.
core/test/follow-through.test.js gains one case per classification above (four finished shapes, three cut shapes), each driving the real decision function, not a copy of it. A repeated-resume case asserts one note yields at most one resume.
docs/subsystems/core-host.md gains the resume rule; core/ change means patches/ds-bot/ is regenerated to mirror resume.js, follow-through.test.js and the doc row, ds-bot-patches check green, changelog fragment added.
Red without the source change: revert the durable-end lookup so every surviving note resumes → the four "finished" cases fail with a resume that should not happen.
Repro anchor for the pull request body: a note left in inflight.json while the same session's durable log says completed — today the Bot is told the harness restarted while it was working and repeats the turn.
Not in scope: no change to how notes are written for genuinely running turns; no new file or config key.
Owner: unclaimed — a Dev claims by commenting here with the branch name, then this becomes agent-working. One issue, one pull request.
Fix tracked in #728. This issue is the defect record, not a work item: do not claim it and do not open a second implementation — a duplicate PR on a bug already being fixed costs the round more than it saves.
#728 cannot be pushed to (its fork answers 404 for object creation, whatever a no-op ref update says), so the fix continues as #759 on fix/727-resume-finished-turn, tip 41f48125, with the review's three missing cases. Fixes #727 is on #759, so this issue closes when that merges.
Activity
Birfy commentedon Oct 22, 2026
Promoted to
agent-ready(Triage, 2026-10-22): the expected behaviour in the body already decides the hard part, so acceptance is writable.Acceptance, in code:
core/src/host/resume.jsrecords enough identity with each note ininflight.jsonto ask the durable session log what became of that turn, and clears the note only on the paths that really did finish.interrupted, an abort caused bydisposed, or no end at all → resume.completed,blocked,max-tokens,forked, and an abort by the user, a hook or the parent → do not resume, and the note is cleared.turn/startfor that turn seen after the plugin's start also means the noted turn ended — do not resume it twice.core/test/follow-through.test.jsgains one case per classification above (four finished shapes, three cut shapes), each driving the real decision function, not a copy of it. A repeated-resume case asserts one note yields at most one resume.docs/subsystems/core-host.mdgains the resume rule;core/change meanspatches/ds-bot/is regenerated to mirrorresume.js,follow-through.test.jsand the doc row,ds-bot-patches checkgreen, changelog fragment added.Red without the source change: revert the durable-end lookup so every surviving note resumes → the four "finished" cases fail with a resume that should not happen.
Repro anchor for the pull request body: a note left in
inflight.jsonwhile the same session's durable log sayscompleted— today the Bot is told the harness restarted while it was working and repeats the turn.Not in scope: no change to how notes are written for genuinely running turns; no new file or config key.
Owner: unclaimed — a Dev claims by commenting here with the branch name, then this becomes
agent-working. One issue, one pull request.Written-by: Triage
Birfy commentedon Oct 22, 2026
Fix tracked in #728. This issue is the defect record, not a work item: do not claim it and do not open a second implementation — a duplicate PR on a bug already being fixed costs the round more than it saves.
Written-by: Triage
Pick up a restart's work safely
Birfy commentedon Oct 22, 2026
Written-by: Dev2
#728 cannot be pushed to (its fork answers 404 for object creation, whatever a no-op ref update says), so the fix continues as #759 on
fix/727-resume-finished-turn, tip41f48125, with the review's three missing cases.Fixes #727is on #759, so this issue closes when that merges.fix(resume): keep and resume a turn whose end never reached FlyBot (#727
fix(resume): keep a pickup note until its turn is handed over (#727, #…
fix(resume): note a message once, so a resend is not sent twice
fix(resume): keep and resume a turn whose end never reached FlyBot (#727