Skip to content

release: v0.13.10 — unwedge tasks and event consumers after host failures - #76

Merged
mai1015 merged 7 commits into
mainfrom
fix/codex-home-and-recovery
Sep 30, 2026
Merged

mai1015 merged 7 commits into
mainfrom
fix/codex-home-and-recovery

Conversation

@mai1015

@mai1015 mai1015 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Patch release from a production incident on a NovelKit project (disk filled up, ~10 parallel tasks in a merge-conflict loop).

Changed

  • Review checks run in the Task worktree instead of a fresh temp clone. Every review cloned the candidate into $TMPDIR and re-ran npm install and a cold build there. The worktree is already verified to be at the reviewed commit with no tracked change, so checks now run in place and reuse its node_modules//target/; afterwards the worktree is reset --hard to the reviewed commit and untracked non-ignored output is cleaned so integration sees a clean tree. A check that changes tracked files or moves HEAD still fails the candidate.
  • Review authority carries across mechanical integration (merge-conflict livelock fix). When a Task re-enters review only because Forge rebased it cleanly onto a moved target, or its Worker reconciled a Forge-committed rebase conflict, the new carry_review_authority review on_enter hook keeps the previous approval and goes straight back to merging, provided the project's ci_steps all pass, the changed paths stay inside the reviewed contract's paths, and HEAD is a marker-free descendant of the target tip (at most 5 carries per review). Otherwise the reviewer runs as before. V148 adds the review_authority_carry table and inserts the hook into every stored workflow. Merge-fix prompts (coder and worker) no longer promise a fresh review.
  • Managed CLIs. Codex CLI pin 0.157.0 → 0.159.1 (default model GPT-6.1 Sol); Claude Code 2.1.282 → 2.1.285. Codex model discovery lists gpt-6.1-sol first (efforts low…ultra).

Fixed

  • A passing review is no longer thrown away when Forge's own check re-run times out. Forge re-runs setup steps and checks in a clean checkout with a hard 120s limit per command; a slow cargo test (waiting on a shared build lock) crossed it and every timeout dispatched a whole new reviewer (NK-28: three passing reviews discarded). The limit is now check_timeout_seconds in the review config (1–14,400s, default 30 min, not serialized when unset so existing contracts stay equal). A timeout is not recorded as the verdict; the checks alone re-run (3 attempts), then the Task is parked review_blocked instead of re-dispatching the reviewer.
  • Managed Codex EACCES wedge. A project test left a read-only directory in the Worker's TMPDIR (.codex-managed-home/task-scratch); resetting it failed with Permission denied (os error 13) on every later execution of that Task. Forge now restores owner rwx on that tree before removing it.
  • Outbox consumers wedged by pruned events (Pruned domain_event gaps permanently wedge outbox consumers ("must be checkpointed in sequence order") #75). V146's prune left gaps below lagging cursors; agent-wake-turns, scoped-memory-agent-chat-indexer and attention_projection were stuck since the upgrade and logged ~150k WARNs/day. Ordering is now defined over the next existing sequence, so wedged cursors advance on the next poll without a migration.
  • Unrecorded failed runs. When a coder run failed but the Task never got its failure annotation (disk full → SQLite writes failed), the Task offered only cancel. Dispatcher active recovery now applies the normal executor-failure handling (deferred retry, then executor_failed with reexecute).
  • Conflict markers caught before review. New merge_failed exit guard require_conflict_markers_resolved returns an incomplete conflict repair to the Worker with the file names, instead of spending a full review and letting the next rebase nest markers. V147 adds it to every stored Project workflow.
  • Stale dispatch_failed annotations are cleared when a Task is moved to todo/backlog.
  • Agent commit subjects use the Task title instead of the role prompt's first line (agent: Forge role contract (authoritative):).

Upgrade note

The stored workflow is part of a review's governing context, so Tasks that passed review but had not merged when V147/V148 run get one fresh review (once, not per migration).

Tests

Focused: cli-adapters managed_codex_home (new test reproduces EACCES without the fix), commit::; executors runtime_scope; db migration, domain_event, agent_wake_dispositions (4 new gap tests); services task_service::transition, 3 new dispatcher recovery tests, conflict-marker guard, compatibility_fixtures. cargo clippy -p executors -p cli-adapters -p db -p services --all-targets -D warnings clean. B1: services review-carry tests (clean rebase, conflict repair, new path → full review, no checks → full review, changed governing context, other entries, newer real review supersedes, carry bound), merge-fix prompt tests, compatibility_fixtures incl. V148 idempotence, db review; cli-adapters lib (135); worktree checks: runner test (ignored cache reused, stray output removed, tracked change restored); check-timeout: review runner test (timeout unrecorded) and services cascade test (checks re-run alone, park, duplicate delivery inert); api manual_review_and_comments; web typecheck; cargo clippy --workspace --all-targets -D warnings clean. Full suite runs in CI.

🤖 Generated with Claude Code

mai1015 and others added 7 commits September 29, 2026 17:37
- Managed Codex: restore owner write permission on task-scratch before
  resetting it, so a read-only directory left by a project test no longer
  fails every later execution with EACCES (os error 13).
- Name agent commits after the Task title instead of the role prompt's
  first line ("agent: Forge role contract (authoritative):").
- Clear a stale dispatch_failed annotation when a Task is moved to
  todo/backlog.
- Dispatcher active recovery applies the normal executor-failure handling
  to a Task whose failed run was never recorded (e.g. disk full), instead
  of leaving it with only "cancel".
- merge_failed gains a require_conflict_markers_resolved exit guard so a
  partial conflict repair returns to the Worker before a full review;
  V147 adds it to every stored Project workflow.
- Outbox consumers treat pruned domain_event gaps as contiguous (next
  existing sequence), so cursors wedged behind V146's prune advance again
  (#75).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nflict repairs

A Task re-entering review only because Forge rebased it cleanly onto a moved
target, or because its Worker reconciled a Forge-committed rebase conflict,
keeps its previous approval when CI passes, the change set stays inside the
reviewed paths, and the HEAD is a marker-free descendant of the target tip.
The new carry_review_authority review on_enter hook settles the attempt,
records the carried candidate in review_authority_carry (V148), and cascades
to merging; integration merges the carried commit. Bounded to five carries
per review. Merge-fix prompts no longer promise a fresh review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-run times out

Forge re-runs a review's setup steps and checks in a clean checkout before
accepting the verdict, with a hard 120-second limit per command. A slow
`cargo test` (e.g. waiting on a shared build lock) crossed it, the review
went unverified, and the bounded reviewer retry dispatched a whole new
reviewer each time (NK-28: three passing reviews discarded in a row).

- Per-command limit is now `check_timeout_seconds` in the review config
  (1-14,400s, default 30 min); unset is not serialized into the frozen
  contract, so existing contracts stay equal.
- A check timeout is not recorded as the verdict; the reviewer completion
  re-runs only the checks (3 attempts) and then parks the Task with
  review_blocked instead of dispatching another reviewer. Duplicate
  terminal delivery after the park is inert.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…clone

Forge verified every review by cloning the candidate into a temp dir and
re-running setup and checks there, so each review repeated `npm install`
and a cold `cargo` build (and pushed projects toward a shared target dir,
whose lock contention caused the check timeouts). The worktree is already
verified to sit at the reviewed commit with no tracked change and only
tracked content is delivered, so the checks now run there and reuse its
ignored dependency/build output. Afterwards the worktree is reset to the
reviewed commit and untracked non-ignored output is removed so
integration sees a clean tree; a check that changes tracked files or
moves HEAD still fails the candidate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mai1015
mai1015 merged commit 237df55 into main Sep 30, 2026
10 checks passed
@mai1015
mai1015 deleted the fix/codex-home-and-recovery branch September 30, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant