Repository navigation
fix(agents): finish deletion when personal pins change - #203076
Conversation
Refresh cleanup preservation once when a personal pin publication invalidates precommit preparation. Keep deletion custody and target plans, revalidate current source and execution authority, and never replay unknown native outcomes. Allocate 58 regression-test lines for the real Gateway deletion race, including canonical preference publication and unchanged pin-protection coverage. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRetry agent-session cleanup once when a concurrent personal-pin publication invalidates its prepared snapshot. Example: Delete agent pin-race-agent while another profile saves the pin session:agent:main:pinned.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-confirmed deletion failure with a bounded retry, and I found no introduced correctness defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway agent-deletion owner retains cleanup custody while session storage prepares deletion plans, commits through SQLite workers, and publishes archives and session changes. flowchart TD
A[Agent deletion RPC] --> B[Deletion custody]
B --> C[Prepare pin protection]
C --> D[Session worker commit]
D -->|Known pin conflict once| C
D --> E[Publish archives and session changes]
E --> F[Deletion response]
Technical reviewBest possible solution: Keep the bounded snapshot refresh inside the existing deletion owner while preserving pin protection, target plans, custody, and uncertain-outcome refusal. Do we have a high-confidence way to reproduce the issue? Source establishes the stale-snapshot exception and pending-cleanup path, and the supplied Gateway regression deterministically places a canonical pin publication between preparation and capture; no target code was run during this read-only review. Is this the best way to solve the issue? A single retry using freshly prepared preservation facts is the smallest complete repair, and the local attempt function keeps the existing native and worker paths together without adding another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5e7675ea08cd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +18, Tests +58, Other +2. Total +78 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 21, 2026, 7:46 AM ET / 12:46 UTC. |
Reuse the already-landed upstream repair to unblock deletion CI. Custom state records hydrate normally without contributing context-byte accounting. (cherry picked from commit ed176db) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
|
Merged via squash.
|
* fix(agents): finish deletion when personal pins change Refresh cleanup preservation once when a personal pin publication invalidates precommit preparation. Keep deletion custody and target plans, revalidate current source and execution authority, and never replay unknown native outcomes. Allocate 58 regression-test lines for the real Gateway deletion race, including canonical preference publication and unchanged pin-protection coverage. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(ci): align transcript reuse accounting expectations Reuse the already-landed upstream repair to unblock deletion CI. Custom state records hydrate normally without contributing context-byte accounting. (cherry picked from commit ed176db) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]> (cherry picked from commit 4a66be7) Main-only accounting expectations are absent from the landed diff and were not backported. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
* fix(agents): finish deletion when personal pins change Refresh cleanup preservation once when a personal pin publication invalidates precommit preparation. Keep deletion custody and target plans, revalidate current source and execution authority, and never replay unknown native outcomes. Allocate 58 regression-test lines for the real Gateway deletion race, including canonical preference publication and unchanged pin-protection coverage. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(ci): align transcript reuse accounting expectations Reuse the already-landed upstream repair to unblock deletion CI. Custom state records hydrate normally without contributing context-byte accounting. (cherry picked from commit b802e3f) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* fix(agents): finish deletion when personal pins change Refresh cleanup preservation once when a personal pin publication invalidates precommit preparation. Keep deletion custody and target plans, revalidate current source and execution authority, and never replay unknown native outcomes. Allocate 58 regression-test lines for the real Gateway deletion race, including canonical preference publication and unchanged pin-protection coverage. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> * fix(ci): align transcript reuse accounting expectations Reuse the already-landed upstream repair to unblock deletion CI. Custom state records hydrate normally without contributing context-byte accounting. (cherry picked from commit ed176db) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]> (cherry picked from commit 4a66be7)
What Problem This Solves
Fixes agent deletion reporting cleanup pending when a personal dashboard pin changes while deletion cleanup is being prepared.
User Impact
Agent deletion can finish after one concurrent pin publication without weakening protection for pinned sessions. A repeated conflict still reports cleanup pending; no migration or configuration change is required.
Why This Change Was Made
Retry preparation once, inside the existing deletion owner and custody, only for the typed personal-pin snapshot conflict known to occur before commit or after confirmed rollback. Revalidate live execution and source authority first. Other errors and unknown native outcomes are not retried.
The regression exercises real Gateway agents.create, sessions.create, and agents.delete with a canonical preference publication at the worker preparation boundary. Its 58 added test lines have an exact, separate test-line allocation.
Evidence
6978b40e9d3812083064c97e24de00454d6bf868with the patch-identical port.The controlled publication proves the owner invariant, not the unrecorded historical writer or exact interleaving. A second pin publication can still return a visible, recoverable cleanup-pending result. PR CI remains the broad, exact-head landing gate.
CI accounting follow-up
The inherited transcript-accounting failure reproduced on pinned original main
6978b40e9d3812083064c97e24de00454d6bf868(expected681 bytes/4 events; actual504/3). Upstream PR #203091 already landed the owner-aligned test repair ased176db9220cee37bb02fc3d43fb5ce4fceaf531. This branch now includes that exact repair; no deletion implementation or regression changed. Fresh supported-Bun transcript tests pass3/3, with targeted test types, lint, format and diff checks passing. No waiver or timeout increase. This accounting expectation repair is not independently applicable to the release candidate, which lacks the corresponding production exclusion.The original auto-merge request was explicitly retired before publishing replacement head
bb72c3b0836de880bb749efa5e0b05609a8c405c. Fresh exact-head CI must complete before native replacement recovery; previous failing CI is not treated as current proof.