feat(agent-org): add authoritative team lifecycle - #834
Draft
ShiboSheng wants to merge 1 commit into
Draft
Conversation
Establish durable Starting materialization receipts and a centralized quiescence boundary so Working teams enter Idle only from committed facts. Keep Run View pure-read, bound the global watchdog, and stop frontend polling for hidden or non-pollable teams behind one fail-closed rollout gate. Verification: - cargo clippy --all-targets -- -D warnings - Packaged Tauri Command+5 foreground, hidden, and restore lifecycle passed - Run View refresh left the isolated database byte-identical Pre-commit hook ran. Total eslint: 0, total circular: 0
This was referenced Aug 18, 2026
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-11T00-04-03-019fec6a-b4fe-7333-9faa-514f8a83850e |
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
Replaces #824.
Fixes #756.
Agent Org did not have one authoritative, restart-safe lifecycle boundary for a long-lived Team. Initial materialization, quiescence, Run View reads, watchdog recovery, and frontend polling could not yet guarantee that a Team moves safely through
Starting -> Running/Idle/Failed, becomes free of active Provider work inIdleorFailed, and can later be extended without introducing another state owner.Idleis a durable Team state, not a requirement to destroy reusable in-memory Session state after every Turn. The intended boundary is the same as a normal Rust-native SDE Session: a completed Turn stops all active Provider requests, streams, commands, and Turn-owned background work, while a compatible runtime may remain warm for the shared approximately one-hour Session idle-eviction window and be reused by the next Turn.Solution
This branch starts from
origin/developat641c43c8a37edfb89fb5b07d61bad7083c3bca18and contains one adapted commit only.Startingmaterialization receipts and authoritative lifecycle transitions.Idleonly from committed facts.The resulting PR1 boundary does not add Pause/Resume, Archive/Delete, the Task FSM rewrite, Writer settings, UserDirectedWork, or Group-send behavior. It also does not add an Agent Org-specific per-Member cleanup timer. Failed Teams do not start a runtime; later Pause work releases only the formal runtimes captured by that pause episode, while Archive/Delete owns whole-Team runtime teardown.
Potential risks
Idleperformance path remains unverified on this rebuilt stack.org_run_completetool, so the run correctly retainedcompletion_requested=0and remainedrunningunder the fail-closed empty-task-board rule. This result does not establish a production lifecycle convergence defect.Architecture and performance audit
Reviewed compilation, structure, lifecycle semantics, fail-closed branches, persistence ownership, naming, wire compatibility, initialization parity, and launch/run-view resolver symmetry. The selected change keeps one bounded global watchdog, bounded recovery budgets, shared polling ownership, and the existing bounded Session idle-eviction owner; it introduces no per-component polling owner, per-Member timer, or unbounded cache.
The resource contract distinguishes active work from retained warm state.
Idlemust have no active Provider request/stream, Agent Org-owned process, Wake, poll, or background I/O. A compatible warm runtime is allowed only as passive reusable in-memory state and remains subject to shared eviction and later whole-Team teardown.Performance verdict for this rebuilt tip is blocked, not failed: the packaged fixture did not reach a valid
Idleprecondition, so foreground/hidden Idle, warm reuse, memory, and eviction measurements cannot yet be claimed.Verification
Passed on this PR tip:
cargo check -p agent_core -p org2 -p session_persistence --all-targetscargo test -p agent_core agent_org -- --nocapture— 237 passed.pnpm run typecheckagentOrgRunViewStore.test.ts— 12 passed.git diff --check origin/develop...HEADThe complete stacked tip was also verified after PR3 was added; those results are recorded in #836.
The stacked packaged app was rebuilt successfully with the redesign compiled and enabled:
ORGII_AGENT_ORG_REDESIGN=1 WEBDRIVER=1 pnpm run tauri:build:fast -- /private/tmp/ORG2-stack-834-836.app— passed in 364.3 seconds.org_run_complete; therefore this run did not exerciseRunning -> Idle, and no Idle foreground/hidden, active-work, warm-reuse, memory, or eviction result is claimed.cargo fmt --all -- --checkreports formatting differences already present onorigin/developin untouched files. No changed file in this PR contributes to that output.Deferred verification
org_run_complete, then emits the coordinator final answer.completion_requested=1, committed final output, no remaining quiescence blockers,status=idle, andlast_activity_outcome=completed.running.Commit provenance
7beec790733035741ed7c5591d31e2a8264bea3b-> adapted commit239702009cab1d60baa288a2120cfee0df1b3891, authored by Shibo Sheng.