feat(agent-org): add durable pause and resume handoff - #881
Draft
ShiboSheng wants to merge 3 commits into
Draft
Conversation
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 |
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
Track detachable shell work by its exact Session, Turn, runtime lease, and dialog generation so Pause can stop and verify the whole process group before durable handoff release. Preserve ordinary Stop, Queue, and Force Send behavior, and prevent inverse Pause/Resume controls from accepting one double-click twice. Verification: - cargo test -p agent_core — 3188 passed, 0 failed - cargo clippy -p agent_core --lib -- -D warnings — passed - pnpm test — 1116 files and 8768 tests passed - pnpm typecheck and pnpm lint — passed (5 unrelated warnings) - BuildFast rendered and three-round live Provider acceptance — passed - renamed live Pause/Resume and Task lifecycle smoke — passed Pre-commit hook ran. Total eslint: 5, total circular: 0
ShiboSheng
force-pushed
the
codex/issue-760-pr5-pause-resume
branch
from
August 23, 2026 20:25
4988632 to
a717909
Compare
Resume could leave the original inbox assignment unread or let a Task finish while Turn-owned shell or subagent work was still running. Track exact Session, Turn, and runtime ownership, feed terminal job results back into the same Turn, and release the assignment only after successful Task completion. Bound teardown and fail closed without changing ordinary SDE job behavior. Verification: - cargo test -p agent_core — 3,197 passed, 0 failed - cargo clippy -p agent_core --all-targets -- -D warnings — passed - pnpm test — 8,768 passed - WEBDRIVER=1 pnpm run tauri:build:fast — passed - Real Provider Pause, restart, and Resume acceptance — passed in three isolated rounds Pre-commit hook ran. Total eslint: 5, total circular: 0
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.
PR4 provides formal Task state and ownership, but it does not provide a durable Pause/Resume boundary for in-flight Agent Org work. Without that boundary, a late Turn can cross lifecycle generations, consume work after Pause, clear a replacement runtime, or resume work that is no longer legal.
Real Provider acceptance exposed two additional lifecycle gaps in the initial PR5 implementation:
Solution
Add one durable, generation-fenced Pause/Resume protocol for Agent Org formal work:
releasedonly after the owned work is gone.task_updaterole-aware for strict Providers while preserving the typed parser as the mutation authority.The rollout gate remains off. Archive/Delete, UserDirectedWork, interventions, multi-Member mentions, memory jobs, Goal Loop work, and later delivery-stack features are unchanged.
Potential risks
ORGII_HOME. Rollback means reverting the PR5 commits and reopening the database paired with that code; an older binary must not guess a downgrade of a PR5 database.49ad34970b80530e0be07043cf8012e60e53110cand requires its formal Task FSM, owner authority, Turn context, Member FIFO, and strict-provider empty-placeholder behavior.bar_native.rsbecause a feature-gatedtoggle_panelhelper is absent, and the repository circular-dependency command cannot resolve two existing React artifact?rawimports. The changed/default-feature Rust path and staged import graph pass.Scope and invariants
Verification
Automated checks on the final production diff:
cargo test -p agent_core— 3,197 passed, 0 failed, 2 ignored; doc tests completed with 11 ignored.cargo check -p agent_coreandcargo check -p e2e-test— passed.cargo fmt --all -- --check— passed.cargo clippy -p agent_core --all-targets -- -D warnings— passed; the commit hook also passed scopedagent_coreClippy.cargo clippy -p agent_core --all-targets --all-features -- -D warnings— blocked by the pre-existing untouchedbar_native.rsfeature-combination error described above.pnpm test— 1,116 files and 8,768 tests passed.pnpm typecheck— passed.pnpm lint— exited 0 with five pre-existing warnings in untouched WorkItems components.pnpm check:circular— blocked before graph analysis by the two existing React artifact import-resolution failures described above; commit statistics reported zero circular dependencies in changed files.node --checkand Prettier;git diff --checkpassed.ecaa1c721cbb0f4ec60c0136b85c53531421f1ec.Rendered and packaged-app checks:
WEBDRIVER=1 pnpm run tauri:build:fastpassed with the frontend compile-time gate, Cargowebdriverfeature, and Rust runtime gate enabled. The binary SHA-256 is967fee3656cd0426baff4da073def8079f9a27320e454be210c0ee1a38c9b0fa; the app file-tree manifest SHA-256 is2ccd66ba9a8df02955610cd049bdd3cb4d7f04ca6d56fee727402f680ca166b4.session-controls-uipassed. Ordinary Stop/Queue/Force Send ownership boundaries also passed at their deterministic Rust owner tests.session-controls-uicases are blocked by existing prompt-duplication/stopping-state harness assertions. These are recorded as test-infrastructure failures, not product passes.Real Provider acceptance used one frozen BuildFast binary, fresh isolated homes, independent ports, real Pause/Resume UI controls, direct SQLite evidence, and direct macOS PID/process-group inspection:
All three rounds confirmed:
Architecture and performance audit
Architecture review covered types, lifecycle state transitions, cancellation reasons, resource ownership, duplicate termination paths, cross-domain boundaries, naming, wire compatibility, initialization parity, and symmetric Session/Turn/lease/generation propagation. No PR6 lifecycle, public protocol, or new persistence format was added by the post-acceptance fixes.
Performance review covered active, idle, Paused, restart, and repeated lifecycle behavior. Exact-owner lookup uses a bounded in-memory index instead of global scans; completed jobs are removed immediately; teardown and correction retries are bounded; ordinary background-job wake/retention behavior is unchanged; and no new poller, timer loop, cache, or persistent worker was added.
UI evidence
The packaged app was exercised through real WebDriver/UI controls, then correlated with SQLite rows, runtime counters, replay output, and OS process inspection. No static screenshot is attached because the acceptance is a timed lifecycle/process transition rather than a stable visual state. The PR remains Draft for stacked review.