fix(agent-org): delete all runs for a root conversation - #658
Closed
ShiboSheng wants to merge 1 commit into
Closed
Conversation
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
PR1 records exact Run-to-Session ownership and PR2 blocks fenced Agent Org runtime installation and submissions, but deleting an Agent Org Root still handles only one Run. A Root with historical and live Runs can therefore be rejected or partially handled instead of deleting the complete conversation safely.
Solution
Add a dedicated multi-Run Root deletion protocol that plans every Run from exact
agent_org_run_sessionsmappings, establishes the durable Root fence, cancels and quiescesstarting/running/pausedruntimes, rechecks topology, and removes all Run- and Session-owned SQLite state in oneBEGIN IMMEDIATEtransaction. Failed commits retain the fence and cancelled state for restart-safe retry; successful commits return a deduplicated Root/Worker receipt and perform runtime/cache/filesystem cleanup afterward.The PR also adds bounded 1,024 Run/Session validation, rollback and concurrency coverage, two production HTTP E2E scenarios, and the existing rendered Tauri sidebar deletion regression for completed/running/paused Roots.
Potential risks
codex/issue-642-runtime-submission-defense) first.Verification
cargo test -p agent_core --lib state::commands::session::agent_org_delete_tests -- --nocapture(11/11)cargo test -p agent_core --lib(3189 passed, 0 failed, 2 ignored on clean rerun; first run had one transient SQLite lock in an unrelated sidebar test, which passed alone)cargo check -p e2e-testcargo run -p e2e-test -- --list(212 scenarios; both new scenarios registered)agent-org-multi-run-root-delete-production-command(5/5 checks)agent-org-multi-run-root-delete-rollback-retry(6/6 checks)agent-org-session-delete-ui.spec.mjsvia isolated WDIO/Tauri (3/3)pnpm run typecheckpnpm run check:circulargit diff --checkorgtrack_corewarnings; no-deps checks contain no PR3-file warnings after fixesScope and size