Skip to content

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

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

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

Conversation

@BastiHu

@BastiHu BastiHu commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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 20, 2026 3:39pm UTC

Request Review

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Nov 17, 2026
@github-actions github-actions Bot added the size:L 100-499 effective changed lines (test files excluded in mixed PRs). label Nov 17, 2026
codex and others added 2 commits November 19, 2026 16:43
@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.

This branch was successfully deployed

1 active deployment
Preview — f6032ac7 Deployed Nov 20, 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 PR 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