Skip to content

chore: stabilize SQLite lifecycle verification during deletion - #197609

Merged
roboclaw-bot merged 2 commits into
openclaw:mainfrom
dankarization:codex/sqlite-cli-p3-split-20261112
Nov 13, 2026
Merged

roboclaw-bot merged 2 commits into
openclaw:mainfrom
dankarization:codex/sqlite-cli-p3-split-20261112

Conversation

@dankarization

@dankarization dankarization commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The SQLite lifecycle verifier can race with its own agent run while deleting a session. Gateway correctly rejects the changed session, but the verifier fails before checking the final state.

User Impact

No user-visible behavior changes. This repairs internal lifecycle verification needed by #197334 without weakening the final-state assertions.

Why This Change Was Made

Wait for that owned run to settle and retry deletion once, only for the exact, correlated session-changed response. Other errors and a second rejection still fail. The verifier still requires successful deletion, stable session absence, and empty history. Superseded-history handling lives in the shared proof helper.

This changes test support only. Following review, the callback-only replay tests and redundant CLI fixture rename were removed.

Evidence

On fdbc70597, the canonical runtime build, UI build, CLI transcript cases (9/9), SQLite helper cases (6/6), and the real Gateway built-CLI lifecycle proof (1/1) passed. The initial missing-UI setup timeout and successful same-head rerun are recorded in the qualification report.

Current head bc08a4c7c only removes the reviewed redundant tests/allocation and restores the upstream CLI fixture. Both real verifier source files are byte-for-byte unchanged from that qualified head. The resulting cleanup passed the CLI cases (9/9), formatting, and test-line budget; it has not received a new full local build or a successful additional native autoreview.

Exact-head CI run 43237911264 passed all 31 non-skipped jobs, including the real Gateway built-CLI lifecycle proof (1/1), build artifacts, type checks, and lint. ClawSweeper's exact-head review found no actionable defects. Security Review attempt 2 passed after recovery from the first attempt's GitHub API 503.

The race remains in the verifier on main 2f6061c9bc760d2137ac1dd7abc3a11a2d613220; the recorded failure on #197334 matches the narrow retry. Review of the full two-file change found no blocking correctness issues. No additional local runtime proof was run during maintainer review; exact-head CI supplies that evidence.

Related: #197334. That naming PR no longer carries this test repair.

@clawsweeper

clawsweeper Bot commented Nov 12, 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Nov 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The SQLite lifecycle verifier retries one correlated deletion conflict after its own agent run settles.

Example: The verifier deletes agent:main:dashboard:sqlite-concurrent-delete while its own agent run updates that session.

  • Before: The expected session-changed rejection ends the proof before final-state checks.
  • After: The verifier waits for that run, retries once with the expected session identity, and still requires successful deletion, stable absence, and empty history.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair with a matching recorded failure, reported built-CLI qualification, preserved assertions, and no actionable findings; the aggregate gate remains unresolved.
Proof confidence 🐚 platinum hermit (4/6) This changes internal test support without user-visible runtime behavior; the contributor reports built-CLI lifecycle qualification on byte-identical verifier sources, while the inspected Telegram screenshots concern the separate naming feature.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: A valid concurrent lifecycle conflict makes internal verification fail before it checks the committed final state.
Reason: A recorded failure supports the narrow repair, and the verifier continues to reject unrelated errors, repeated conflicts, retained sessions, and nonempty history.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a documented verifier race that remains on current main, preserves the final-state assertions, and introduces no actionable correctness defects.

Priority: P3
Reviewed head: bc08a4c7c0c996b0d715f21acfcadb19092323bb

Before merge

None.

Findings

None.

Agent review details

How this fits together

The test-support verifier launches an isolated Gateway, sends concurrent session and history requests through real clients, and checks SQLite state and returned history.

flowchart TD
  A[SQLite lifecycle verifier] --> B[Gateway client requests]
  B --> C[Session deletion owner]
  C --> D[SQLite session state]
  C --> E[Correlated conflict response]
  E --> F[Wait for owned run and retry once]
  F --> B
  D --> G[Absence and history assertions]
Loading

Technical review

Best possible solution:

Retain the single correlated retry in test support while leaving Gateway deletion policy and final-state assertions intact.

Do we have a high-confidence way to reproduce the issue?

The source exposes the race, and the linked built-CLI failure records its exact rejection; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The bounded retry fits the existing verifier owner, preserves identity checks and failure outcomes, and avoids changing correct Gateway conflict handling.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7b75336b789c.

Provenance checked

  • Concurrent request ownership and cleanup keeps the original intent (d096bd6: Own acquired resources and concurrent request groups through settlement and cleanup.)
  • Superseded-history handling and final history checks keeps the original intent (4acd0eb: Concurrent history reads may return the exact retryable superseded response; fresh reset and deletion history must still match committed state.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d096bd6 adds test/helpers/sqlite-sessions-transcripts-flip-proof.ts:1415 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d096bd69f2c3; files: test/helpers/sqlite-sessions-transcripts-flip-proof.ts)

PR surface

Tests +41. Total +41 across 2 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 57 16 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 57 16 +41

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:

No label changes.

Label justifications:

  • P3: This improves internal lifecycle-proof reliability without changing shipped product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-12T07:50:19.059Z sha fdbc705 :: needs changes before merge. :: none
  • reviewed 2026-11-12T14:37:23.590Z sha bc08a4c :: needs maintainer review before merge. :: none
  • reviewed 2026-11-12T14:43:40.124Z sha bc08a4c :: needs maintainer review before merge. :: none

Reviewed November 12, 2026, 10:58 AM ET / 15:58 UTC (Revision 4).

Copy link
Copy Markdown
Contributor Author

Exact-head P3 qualification

Qualified on clean head fdbc70597ece26f677e731651b3b1cb9aa2475a9 with Node 24.22.1. The build used the task-authorized host settings OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB=4352 and OPENCLAW_PLUGIN_SDK_BOUNDARY_ROOT_SHIMS_TIMEOUT_MS=900000.

  • Runtime build-all completed successfully (8m10s).
  • CLI transcript test: 9/9 passed.
  • SQLite lifecycle-conflict helper tests: 6/6 passed.
  • pnpm ui:build: exit 0 (65s).
  • Built-CLI proof, pnpm test test/scripts/sqlite-sessions-transcripts-flip-proof.built-cli.e2e.test.ts --maxWorkers=1: 1/1 passed (exit 0; 141s shard).
  • Format check passed on all four modified TypeScript files.
  • check:test-lines-ratchet --base 81720a0ebe47170e91d4a1113e99682ad129cb16 --no-merge-base: passed (6,672,286 lines; ceiling 6,672,336).
  • Checkout remained clean and at the same head before and after.

Failed first built-CLI retry

The first full-runtime-build retry is recorded as a failure, not a pass. Runtime build succeeded, but the fresh fixture's Doctor repair stalled at the UI protocol step and was terminated by its 60-second bound. Gateway then correctly refused to start because the synthetic fixture still had a legacy session store; the proof reported the remaining fixture JSONL files. This was setup incompleteness, not a failed product assertion. After building the missing Control UI assets with pnpm ui:build, the same exact-head built-CLI test passed without source or assertion changes.

The first-run log and successful retry logs are retained with the qualification artifacts.

The independent review's callback-only-test and redundant-fixture-rename suggestions remain separate review feedback; the requested assertions have not been weakened.

@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Nov 12, 2026
@dankarization dankarization changed the title test: separate SQLite proof and CLI cost fixtures test: retry a settled SQLite proof deletion once Nov 12, 2026
@dankarization
dankarization marked this pull request as ready for review November 12, 2026 14:30
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the requested cleanup in bc08a4c: removed the callback-only replay suite and redundant CLI fixture rename. The real Gateway verifier now has executed proof in the qualification report above; its source is unchanged by this cleanup. The PR body distinguishes that qualified head, the cleanup checks, and current CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T14:35:19.270098Z bc08a4c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 12, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Another current occurrence from #197334: head 573cad720 hits the same concurrent-delete proof failure, “Session … changed before deletion. Retry.” Failed built-CLI job.

The selected type, lint, channel and UI jobs passed. I kept this repair separate; the overall naming PR gate is still red while this proof fails.

Copy link
Copy Markdown
Contributor Author

The current head bc08a4c passed all 31 non-skipped jobs in CI run 43237911264, including build artifacts, types, lint and the CI gate.

The red commit status comes from the separate security-review job. Its log ends with:

GitHub API GET /repos/openclaw/openclaw/pulls/197609 failed: 503 Service Unavailable

I tried rerunning just that failed job, but the GitHub integration returned 403 (Resource not accessible by integration). Could a maintainer rerun that job? There is no source/test failure in this run to repair.

@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 13, 2026
@roboclaw-bot roboclaw-bot changed the title test: retry a settled SQLite proof deletion once chore: stabilize SQLite lifecycle verification during deletion Nov 13, 2026
@sallyom sallyom self-assigned this Nov 13, 2026
@roboclaw-bot
roboclaw-bot merged commit 5263761 into openclaw:main Nov 13, 2026
207 of 211 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…law#197609)

Repair the SQLite lifecycle verifier’s race with its own agent run. Retry deletion once only after the exact correlated session-changed rejection and owned-run settlement. Preserve successful deletion, stable database absence, and empty-history assertions. No production behavior changes.

Validated by exact-head CI run 43237911264, including the built-CLI lifecycle proof, and successful Security Review attempt 2 of run 43239220762 after a GitHub API 503.

Co-authored-by: Daniil Karpenko <[email protected]>
Co-authored-by: sallyom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants