Skip to content

fix(agents): finish deletion when personal pins change - #203076

Merged
tideclaw-bot merged 2 commits into
mainfrom
fix/agent-delete-pin-publication
Nov 21, 2026
Merged

tideclaw-bot merged 2 commits into
mainfrom
fix/agent-delete-pin-publication

Conversation

@tideclaw-bot

@tideclaw-bot tideclaw-bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Controlled real-Gateway regression fails on unchanged production with the same cleanup-pending / personal-pin conflict observed in CI, and passes with the fix on Node 24 and the pinned supported Bun runtime. Full Gateway file: 4/4, including the original overlapping-operator case.
  • Focused purge/native-settlement/error tests: 15/15; actual personal-pin protection and stale/pending-write guards: 3/3. Existing protections remain intact.
  • Targeted core and Gateway-test typechecks, canonical lint (both source files), format, test-line allocation, session-accessor boundary, SQLite transaction boundary, and whitespace checks pass on the original repair checkout and on main base 6978b40e9d3812083064c97e24de00454d6bf868 with the patch-identical port.
  • Fresh independent source review of the exact patch, retry settlement, sole pin-conflict producer, regression, and proof completed without outstanding findings. Automatic review was not invoked, as requested.

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 as ed176db9220cee37bb02fc3d43fb5ce4fceaf531. 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.

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]>
@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@tideclaw-bot
tideclaw-bot marked this pull request as ready for review November 21, 2026 12:29
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M labels Nov 21, 2026
@tideclaw-bot
tideclaw-bot enabled auto-merge (squash) November 21, 2026 12:32
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Retry 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.

  • Before: The stale pin snapshot aborts cleanup and agent deletion reports cleanup pending.
  • After: Cleanup refreshes pin protection and retries once; a second conflict still reports cleanup pending.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair and Gateway regression are coherent, but behavioral evidence remains harness-based and the failing exact-head transcript-accounting check is unresolved.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored bot PR is outside the contributor proof gate; supplied behavioral evidence is the reported red/green real-Gateway RPC regression, without a separate live artifact. Source verifies unchanged stored formats, deletion selection, and pin values, so no migration is needed.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Agent deletion can report cleanup pending when an unrelated personal-pin save invalidates cleanup preparation.
Reason: The maintainer-authored direction removes a recoverable administrative failure without changing pin values, deletion permissions, configuration, or retention policy.

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
Reviewed head: cadf68ecc764314499f77542633bdd09490935c3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +18, Tests +58, Other +2. Total +78 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 125 107 +18
Tests 1 58 0 +58
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 185 107 +78

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A concurrent preference publication can interrupt a user-triggered agent deletion, with limited scope and an existing visible cleanup-pending result.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concurrent preference publication can interrupt a user-triggered agent deletion, with limited scope and an existing visible cleanup-pending result.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Determine whether the transcript-accounting failure is inherited or caused by this patch before landing.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

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]>
@tideclaw-bot
tideclaw-bot merged commit 4a66be7 into main Nov 21, 2026
126 checks passed
@tideclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@tideclaw-bot
tideclaw-bot deleted the fix/agent-delete-pin-publication branch November 21, 2026 14:05
tideclaw-bot added a commit that referenced this pull request Nov 21, 2026
* 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
* 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]>
tideclaw-bot added a commit that referenced this pull request Nov 23, 2026
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants