feat(journal): v0.6.27 — BU-4 resume-not-cancel boot reconcile#294
Merged
Conversation
… boot When the durable workflow_journal backend (Postgres) is active, the daemon boot/steady-state orphan sweep now RESUMES in-flight runs instead of CANCELLING them, so a restart/redeploy that wiped the local volume picks up exactly where it left off. - recover_orphaned_running_workflows gains a resume_orphans gate: when the durable journal is active (and ANIMUS_DAEMON_DISABLE_JOURNAL_RESUME is unset), resumable orphans are PRESERVED (not cancelled); only genuinely unresumable runs (no addressable current phase) still cancel. No-journal (SQLite) path is byte-identical to pre-BU-4. - resumable_orphans_for_redispatch + dispatch leg: preserved no-checkpoint runs are re-dispatched from their current phase boundary via a fresh runner (execute --workflow-id continues the persisted run). Runs with a mid-phase session checkpoint continue to recover via auto_resume_running_checkpoints. - Guardrails: started_at grace + manual/approval guards retained; live runners (ProcessManager active set, pid registry, AND live agent records) excluded to prevent double-dispatch; within-tick subject dedupe; resume runs before queue leasing so the lease excludes resumed subjects; blocked (held) checkpoints skipped; failed early-exit resume targets terminalized so they cannot loop. - Kill-switch ANIMUS_DAEMON_DISABLE_JOURNAL_RESUME forces the old cancel path. Adds durable_journal_active(), SubjectDispatch resume spawn (spawn_workflow_runner_resume / build_runner_command_with_resume), and phase_session::blocked_checkpoint_workflow_ids.
# Conflicts: # crates/orchestrator-core/src/workflow.rs
…ble journal → exact mid-task resume)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
When the durable
workflow_journal(Postgres) backend is active, the daemon boot/steady-state orphan sweep now resumes in-flight workflows from the journal instead of cancelling them — restart/redeploy mid-task picks up where it left off.Decision table per orphaned (past-grace, non-manual) Running run: no-journal→cancel (byte-identical to today); live runner→skip; in grace→skip; has session-id→mid-phase resume (session reattach); phase-boundary only→re-dispatch fresh runner from
current_phase; unresumable→cancel.Guardrails: gated on
durable_journal_active+ kill-switch off; no double-dispatch (excludes PM-active/pid-registry/live-agent subjects + within-tick dedupe + resume-before-lease); grace/manual/merge-conflict guards retained; kill-switchANIMUS_DAEMON_DISABLE_JOURNAL_RESUME=1forces the old cancel path. Merges v0.6.26 (journal import).Caveat (follow-up)
Phase-boundary re-dispatch relies on the workflow-runner honoring
execute --workflow-id(continue, not duplicate). If an older runner rejects it, the spawn fails safe (run preserved, no dup/cancel). Mid-phase resume (session reattach) is unaffected.Verification
build/clippy/fmt clean; 7 new reconciliation tests + journal_client/phase_session units pass; pre-existing
decision_gate::workflow_*+ config_source-dependent daemon-runtime tests fail on clean main too. codex 7 substantive rounds — all P1s fixed (duplicate-run, live-agent exclusion, livelock); round 8 didn't converge (budget), round-7 P1 re-verified against source.🤖 Generated with Claude Code