feat(agent-org): add durable pause and resume handoff - #881
Draft
ShiboSheng wants to merge 1 commit into
Draft
Conversation
Persist Pause episodes and per-Turn handoff receipts so a Team can stop formal work immediately, drain runtimes safely, and resume only work that remains legal after restart or concurrent state changes. Add runtime leases, generation-fenced Inbox and Task boundaries, one-shot continuation dispatch, paused Group Chat enforcement, push-driven draining UI, strict-provider task_update schemas, and rendered recovery coverage. Verification: - cargo test -p agent_core (3175 passed, 2 ignored) - cargo clippy -p agent_core --all-targets -- -D warnings - pnpm vitest run (1116 files, 8767 tests) - pnpm typecheck and changed-file ESLint - BuildFast packaged app with 20/20 ten-runtime Pause/Resume samples - codexharry GPT-5.4 Mini packaged-app Pause/restart/Resume smoke Pre-commit hook ran. Total eslint: 5, total circular: 0
Collaborator
Author
|
orgii://cloud/session/ref?v=1&org=bfa7b134-2486-45fa-81ad-a369441fafb4&owner=776dbd69-ac1d-4f72-a0d4-69cb4f2667dd&session=codexapp-rollout-2026-08-22T18-01-45-01a028eb-4fec-74b2-bbb7-528b8361c483 |
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.
Problem
Fixes #760.
The PR4 baseline can change a Team status and cancel whole Sessions, but it cannot durably describe which formal Turns were paused, prove which runtime instance may be released, or resume only work that remains legal after a pause/restart boundary. A late Turn can therefore cross lifecycle generations, consume formal Inbox work, or clear a replacement runtime; the UI can also remain stuck on draining after a transient push gap.
Solution
Add a durable Pause/Resume handoff protocol for Agent Org formal work:
task_updateexpose role-aware strict-provider schemas while preserving the typed parser as the mutation authority.The rollout gate remains off. Archive/Delete, UserDirectedWork, interventions, multi-Member mentions, and the other later delivery-stack features are unchanged.
Potential risks
ORGII_HOME. Rollback uses the database paired with the target commit; an older binary must not open the new manifest and guess a downgrade.Scope and invariants
Verification
Automated checks:
cargo test -p agent_core— 3,175 passed, 0 failed, 2 ignored; doc tests completed with 11 ignored.cargo clippy -p agent_core --all-targets -- -D warnings— passed; only the existing future-incompatibility notice forblock v0.1.6was emitted.pnpm vitest run— 1,116 files and 8,767 tests passed.pnpm typecheck— passed.agent_coreandorg2, commitlint, and commit stats passed (Total eslint: 5, total circular: 0).node --check;git diff --checkpassed.pnpm run check:circulardid not reach graph analysis because Madge cannot resolve two existing?rawReact artifact imports inreactArtifactDocument.ts; that file is outside this diff. The staged-import hook reported zero circular dependencies in changed files.Rendered and packaged-app verification:
49886324af912783f871a353a70aa51d02595957passed. Verified artifact:/private/tmp/ORG2-PR5-49886324.app; binary SHA-2566c20b63aefb6d498195573aace4503727c6fa738f9bab6973a7bba2834c60675.codexharryaccount with GPT-5.4 Mini. Formal Task create/start/read/complete succeeded with zerotask_updateerrors; Pause, app restart, history, and Resume completed with generation1 -> 2 -> 3, one consumed episode, the completed Task unchanged, and zero unread Inbox rows. No credential or token is included in this diff.Architecture audit
All ten layers were checked: compilation/types, dead and duplicate paths, naming, state semantics, default branches, cross-domain boundaries, understandability, wire parity, initialization/restart consistency, and Session-to-Run resolver symmetry. The old direct status mutators and automatic resume path were removed; strict 17-table initialization and restart continuation dispatch are covered by regression tests.
UI evidence
The packaged app was exercised through Computer Use and WebDriver using real product controls. No static screenshot is attached because the acceptance is a lifecycle transition (Paused -> draining -> Paused -> Resume) plus persisted SQLite/runtime evidence rather than a stable single frame; the PR remains Draft for stacked review.