Repository navigation
feat(#892): durable halt-and-resume for waitable rate-limit windows - #895
Merged
admarble merged 3 commits intoAug 4, 2026
Merged
Conversation
A waitable-window halt (#860 classification) now writes windowHalt: { resumeAt, phase, reentries } to issue state before exiting (lock released on exit as usual), and the new `sequant resume` command re-enters once the window reopens: a clean no-op (exit 0) before resumeAt, bounded re-entries (2/issue, mirroring AUTO_WAIT_MAX_WAITS) after, delegating to the normal run path with --resume semantics. Any phase success or a non-window failure clears the record so re-entry never fires on a stale or non-waitable halt. Status surfaces (CLI + MCP) show halted issues as resumable-at; docs ship the cron/launchd recipe. Fixes #892
Mutation result (gate test, per CLAUDE.md): deleting the recipe payload between the recipe:start/end markers in docs/reference/halt-and-resume.md fails exactly 'ships cron and launchd recipes invoking sequant resume in the delimited region' (1 failed / 11 passed in resume.test.ts); restored.
5 tasks
…ommand-shell tests 1. A due issue whose per-issue lock is held by another session is now skipped WITHOUT consuming one of its bounded re-entries (read-only LockManager.check probe before the increment; the race window shrinks from 'any concurrent holder' to the probe-to-acquire gap). 2. formatIssueState exported @internal; windowHalt/autoWait pause lines pinned by status-format.test.ts (present + absent cases). 3. resumeCommand shell covered via injected deps against a real StateManager on a temp state file: arg validation, all exit-code paths, persisted re-entry consumption, dry-run non-consumption, lock-skip, subset runs, requested-issue filtering (10 tests). bin/cli.ts wraps the action so commander's Command third positional cannot land in the deps param.
admarble
deleted the
feature/892-feat-run-durable-halt-and-resume-for-waitable-
branch
August 4, 2026 14:28
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.
Summary
Durable halt-and-resume for waitable rate-limit windows (#892) — the follow-up the #860 decision record filed. A run halting on a waitable window (
five_hour/seven_daywith a future reset) now writeswindowHalt: { resumeAt, phase, reentries }to issue state before exiting cleanly (lock released via existing exit handlers), and the newsequant resumecommand re-enters once the window reopens.recordWindowHaltStateat both batch-executor halt sites;resumeAt = resetsAt + AUTO_WAIT_BUFFER_MS(same clock as auto-wait). Billing/transient failures never write; any phase success or non-window failure clears the record.sequant resume [issues...] [--dry-run]— clean no-op (exit 0) beforeresumeAt, safe for cron/launchd; after, consumes one bounded re-entry (2/issue, mirroringAUTO_WAIT_MAX_WAITS) and delegates to the normal run path with--resumesemantics (fix(chain): --chain --ready-gate resume re-executes already-gated links (COMPLETED_STATUSES misses waiting_for_human_merge/blocked) #837 completed-issue + phase-marker skipping). Exhausted bound → today's labeled terminal message, exit 1.sequant status+ MCP status show "⏸ Halted … resumable at ";docs/reference/halt-and-resume.mdships the copy-pasteable cron/launchd recipe; README/run-command/decision-record cross-linked; CHANGELOG entry.AC Verification
releaseAll()exit-handler testsrecipe:start/endmarkersMutation result (gate test, per CLAUDE.md): deleting the recipe payload between the
recipe:start/recipe:endmarkers indocs/reference/halt-and-resume.mdfails exactly the AC-5 gate test (ships cron and launchd recipes…— 1 failed / 11 passed inresume.test.ts); restored after verification.Test plan
windowHaltResumeAtMs+ 4 wiring tests, 12 resume-command tests--help,--dry-run, pre-resumeAt no-op (exit 0), exhausted bound (exit 1), empty state (exit 0)QA verdict: AC_MET_BUT_NOT_A_PLUS — recommendation-grade notes only (see issue comment).
Fixes #892
🤖 Generated with Claude Code