Skip to content

fix(playbooks): stop the holder when cancelling a run - #1089

Open
BastiHu wants to merge 2 commits into
feat/playbooks-integrated-331968a7from
feat/playbooks-789-331968a7
Open

BastiHu wants to merge 2 commits into
feat/playbooks-integrated-331968a7from
feat/playbooks-789-331968a7

Conversation

@BastiHu

@BastiHu BastiHu commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #789.

Migration 063 records cancellation and archive recovery. A delayed archive targets the old handoff and preserves replacement work. Peer handoffs enforce the owner’s current limits.

The archive port passed 142 tests. The additional holder-limit and waiting-turn changes passed 27 relay and integration tests and server typecheck. Rebased head · Stack verification and outstanding evidence.

Original submission and earlier verification

Problem

Cancelling a playbook left its current worker running, while archiving a Crew incorrectly ended the Captain's run. Closes #789.

What changed

Cancellation now commits the ended run before stopping its recorded non-owner holder through the existing upstream Stop path. The durable result distinguishes idle, stopped, unavailable, and refused holders; retries never issue another Stop, including cancellations recorded before this upgrade. Owner archive/delete events and startup recovery cancel the owner's run. Crew archive preserves it for reassignment or takeback.

This is stacked on #1088. Migration 062 precedes checkpoint migration 063 in #1090; progress follows in #1091.

Live testing

Automated real-orchestrator coverage captures the active holder run, cancels the playbook, verifies that exact run becomes interrupted, and verifies retry adds no turn items. The owner-archive checkpoint closure is covered in the following integration layer.

Combined validation at bc432f7c64040976df0400625870a4b235a8e81b: check:changed passed: 568 tests across 43 files, all 36 affected package typechecks, 17 React compiler cases across 12 selected files, format, lint, Knip, and GraphQL. Captain browser smoke verified the approval-required library preview, Inbox loading, a completed free Replay turn, and restoration of that transcript after an at-rest server restart. Replay exercises provider rendering; it does not verify the Playbook approval flow. Detailed report: artifacts/test-reports/feat-playbooks-next-integrated-331968a7/bc432f7c6.md. Real-model Stop/Continue, held-turn restart, and migration rehearsal on copied real data remain unrun; the earlier request to authorize paid test models is still pending. No live deployment was performed.

Upstream impact

Only the measured agent context budget changes outside J5-owned code; recorded in FORK.md cases 2 and 110. Stop uses the existing provider-neutral implementation and Captain exception.

Checklist

  • One concern: cancellation and owner lifecycle
  • Tests cover changed behavior, retries, mode limits, and upgrade history
  • UI changes: no new control in this layer; readable history labels ship in the progress layer
  • Live testing: exercised and unexercised paths are stated above
  • Upstream-owned files recorded in FORK.md
  • Upstream product: existing behavior reused; no new divergence
  • Surfaces: MCP, shared store, lifecycle stream, and provider-neutral Stop path covered
  • Product and user docs updated

Implemented with GPT-6 Astra in the Codex harness and a J5 Crew.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 24, 2026 11:01am UTC

Request Review

@Jacksondr5

Copy link
Copy Markdown
Owner

Direction for the whole stack, before the full review, is in this comment on #1086. We'll review once the stack is rebased onto j5/main after #1205.

@BastiHu
BastiHu force-pushed the feat/playbooks-integrated-331968a7 branch from 82d64d2 to 59c1110 Compare November 24, 2026 11:00
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from f6032ac to 7078f14 Compare November 24, 2026 11:00
@BastiHu

BastiHu commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Jacksondr5, Migration 063 records cancellation and archive recovery. A delayed archive targets the old handoff and preserves replacement work. Peer handoffs enforce the owner’s current limits. The archive port passed 142 tests. The additional holder-limit and waiting-turn changes passed 27 relay and integration tests and server typecheck. Commit · Stack-wide response and outstanding evidence.

This branch was successfully deployed

1 active deployment
Preview — 7078f14e Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants