Release exp: cascade delegated subagent deletion (#5926) - #6073
Merged
Merged
Conversation
Contributor
| from api.models import delete_cli_session | ||
|
|
||
| delete_cli_session(sid) | ||
| state_db_cleanup_failed = not delete_cli_session(sid) |
Contributor
There was a problem hiding this comment.
Missing Database Becomes Failure
When a WebUI-only profile has no state.db, delete_cli_session() returns False and this line reports state_db_cleanup_failed=true. The WebUI session was already deleted and tombstoned, but the client shows “Delete failed” and swipe callers restore its row because deleteSession() returns false. Treat an absent, inapplicable CLI database separately from an operational cleanup failure.
🎬 Cutter preview — PR #6073
|
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.

Ships #5926 (relates #5307), @pxxD1998 — a destructive-path fix that converged over 6 rounds to a fully-verified SAFE state.
Deleting a parent session now cascades removal of its delegated/subagent sessions + on-disk transcript artifacts (incl Agent-migrated legacy delegates), while never over-deleting siblings, unrelated sessions, or any still-live child.
Codex authoritative gate SAFE (round 6): no over-delete of live/sibling/unrelated data (FK cascade scoped to removed IDs; unrelated usage/compression-lock/Telegram rows survive); the migrated-delegate under-delete is fixed without widening to non-delegates; the new cross-process file lock (POSIX flock / Windows msvcrt) was verified on a real two-process test — serialized recovery + cleanup, no overlap/deadlock, released, persistent lock file never unlinked; fail-closed on missing/unqueryable state.db, liveness-query failure, and absent lock primitive (20-call no-primitive probe preserved all rows + artifacts, no FD growth); recovery-from-prior-failed-run works; partial cleanup reported honestly not shown as success. 51 focused tests. Thanks @pxxD1998 for the careful multi-round hardening on a data-deletion path.