Skip to content

test(sessions): scope reclamation faults to their connection - #138481

Merged
steipete merged 1 commit into
mainfrom
codex/reclamation-fault-owner
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/reclamation-fault-owner

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a native SQLite regression-test failure where a simulated commit-barrier error could escape into archive publication instead of exercising commit recovery.

The failure was observed in the runtime-config CI shard on 08665323601d6d41bc6f649806563fdbd1df6011: one failed test out of 4,192. This is a separate follow-up to the reclamation tests introduced by #137672, not an Apple fixture change.

Why This Change Was Made

The integration test previously armed the next module-wide immediate transaction to throw. A Worker can legitimately finish its transaction before the parent checks its shared settlement state; in that case the parent does not need another lock transaction. The unused injected error then reached the later archive-schema transaction.

The test now uses the existing sibling-test pattern: capture the exact reclamation connection, call its real close, then inject one close error. This exercises recovered settlement errors regardless of which valid settlement path wins. The case name identifies that fault, and its deletion, archive-file, lifecycle-event, and fault-delivery assertions are preserved. The existing lower-level transaction-barrier fault tests remain unchanged.

User Impact

No production behavior changes. This repairs the test's fault ownership without changing SQLite schemas, store semantics, commit authorization, recovery policy, or timeouts. The one-file test delta is +13/−9 lines, net +4.

Evidence

On pinned main 8d060cd03dc4f6ae9ad842d4ba2f84cc39e9b98e, a private ordering control forwarded real commit approval and waited for the real Worker's settlement before letting the parent inspect it. It did not write shared commit state or fabricate results. The original test then failed at the same ensureSessionTranscriptArchiveSchema call as hosted CI. With the repaired injection, the same controlled case passed. The four other cases were filtered out of those two focused runs, not counted as passes.

After removing the diagnostic ordering control, both complete admission-race and commit suites passed 16/16 tests, zero skipped, in 88.899 seconds. They cover current/historical admission, retired caller authority, transient/permanent/closed barrier failures, Worker commit/rollback/exit, expired authorization, and successful/rejected close-fault settlement. The controlled RED and GREEN both finalized normally, with owned process groups gone.

The test and reclamation/publication owners match the failed CI source; current main's separate native transaction-nesting refactor is retained and disclosed. The private ordering control is not in this patch. All 20 canonical changed-file checks passed, including targeted test types, formatting, dead-export scans, and lint. A fresh independent P0–P3 review was scoped-clean. Exact-head canonical CI run33905912704 subsequently completed successfully at c6fdfae. The original failed shard remains retained as defect evidence.

Review disposition

The completed ClawSweeper review found no code or security defect and requested maintainer handling. This repair is being handled under the maintainer’s explicit fix-and-land direction, with direct source/owner review, the retained controlled reproduction,16 passing owner/sibling cases,20 canonical checks, independent review and green exact-head CI. No required check or independent-approval rule is bypassed.

Inject the recovered close error on the exact short-lived commit-barrier connection. A settled Worker can legitimately skip the lock transaction, leaving the former global one-shot fault to escape into archive publication. Preserve deletion, archive, lifecycle and fault-delivery assertions and the existing transaction-failure sibling coverage.
@steipete steipete self-assigned this Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 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 size: XS maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 4, 2026, 3:44 PM ET / 19:44 UTC.

ClawSweeper review

What this changes

This PR makes the SQLite session-reclamation regression test inject its recovered error when the short-lived commit-barrier connection closes, rather than on an unrelated later transaction.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open. This focused test repair replaces a global one-shot transaction fault with a close fault on the reclamation coordinator connection, matching the lower-level owner test; current main still has the race-prone setup. No introduced correctness or security defect was found, but the maintainer label requires explicit maintainer handling.

Priority: P3
Reviewed head: c6fdfae1208e9886e01c3de6ef5b3b1a84bda3f1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, owner-aligned regression-test repair with no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only a deterministic regression test; the external-contributor real-behavior-proof gate does not apply, and supplied evidence includes focused red/green runs plus exact-head CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes only a deterministic regression test; the external-contributor real-behavior-proof gate does not apply, and supplied evidence includes focused red/green runs plus exact-head CI.
Evidence reviewed 5 items Current-main test behavior: Current main still arms the next module-wide immediate transaction from the commit-request hook, so a later archive transaction can consume the fault if the Worker settlement path does not acquire that transaction.
Commit-barrier owner: The parent opens one short-lived database connection, waits for Worker settlement, and records a close error as recoverable only after settlement; the PR targets that connection's close path.
Established sibling fault pattern: The direct commit-barrier suite already opens the coordinator connection, calls its real close, and then throws a close error, preserving the authoritative outcome assertion.
Findings None None.
Security None None.

How this fits together

Session deletion materializes archives, asks a Worker to commit SQLite changes, then publishes deletion and archive events. The parent-side reclamation barrier keeps caller authority valid until the Worker's transaction settles.

flowchart LR
  A[Session deletion request] --> B[Archive materialization]
  B --> C[Reclamation Worker]
  C --> D[Parent commit barrier]
  D --> E[SQLite transaction settles]
  E --> F[Archive publication]
  F --> G[Deletion event]
Loading

Before merge

  • Complete next step (P2) - A maintainer must review this maintainer-labeled PR before merge.
Agent review details

Security

None.

PR surface

Tests +4. Total +4 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 13 9 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 13 9 +4

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +13/-9 The change is confined to regression-test fault ownership and does not alter runtime, schema, or configuration behavior.

Technical review

Best possible solution:

Keep the handle-scoped fault injection and land it after maintainer review, retaining the separate lower-level barrier-close coverage.

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

Yes—source inspection shows the former module-wide one-shot fault can be consumed by a later transaction, and the supplied CI evidence identifies that resulting regression-test failure.

Is this the best way to solve the issue?

Yes—the changed injection follows the existing coordinator-close test pattern and faults the owner whose recovered close behavior this case is intended to verify.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7911a0cd12ac.

Labels

Label changes:

  • add P3: This is a narrowly scoped test-reliability repair with no user-visible production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only a deterministic regression test; the external-contributor real-behavior-proof gate does not apply, and supplied evidence includes focused red/green runs plus exact-head CI.

Label justifications:

  • P3: This is a narrowly scoped test-reliability repair with no user-visible production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only a deterministic regression test; the external-contributor real-behavior-proof gate does not apply, and supplied evidence includes focused red/green runs plus exact-head CI.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit e8e09cb into main Sep 4, 2026
117 checks passed
@steipete
steipete deleted the codex/reclamation-fault-owner branch September 4, 2026 19:56
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 4, 2026
Reuse the canonical startup baseline from #138449, terminal-parent QA
acknowledgment from #137342, and handle-scoped reclamation fixture from
#138481. Keep the Watch, Rust and Gateway/provider production sources
unchanged from the verified 907 native and real-provider checkpoint.

The four-file delta has a clean independent review. Source binding retains
all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and
baseline proof remain source-specific. No required check, timeout or size
allowance is disabled.

Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Sep 5, 2026
Backport #138481. Fault the exact commit-barrier connection cleanup instead of
an optional next transaction, preserving deletion, archive, lifecycle and
transaction-failure coverage without changing runtime or database behavior.

(cherry picked from commit e8e09cb)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…w#138481)

Inject the recovered close error on the exact short-lived commit-barrier connection. A settled Worker can legitimately skip the lock transaction, leaving the former global one-shot fault to escape into archive publication. Preserve deletion, archive, lifecycle and fault-delivery assertions and the existing transaction-failure sibling coverage.
steipete added a commit that referenced this pull request Sep 5, 2026
* feat(watch): add native standalone realtime voice

Add opt-in Talk on Watch with provider-direct WebRTC/Opus, scoped Gateway
control and explicit call/audio ownership. Preserve phone-mediated voice.

Resolve native endpoints consistently across ICE and Network.framework,
fence late resolver/media work after cancellation, and release received
Opus promptly after packet loss while dropping late speech. Keep recoverable
provider notices visible without closing the session; make setup actionable.

Source review passes all eleven sections through P3. Native engine RED/GREEN
passes eleven final cases; real Watch Simulator resolver classification and
held-result cancellation pass fifteen and sixteen cases respectively.
Full device/provider/current-base CI verification remains a landing gate.

Uses the already-landed app-local companion journal; adds no database schema
or protocol-version change. Physical Watch microphone/speaker, background
and endurance behavior remains unverified.

* fix(watch): use OS entropy for ICE credentials

Supply fresh ICE credentials through the native engine's existing owner API
instead of relying on the pinned library's non-cryptographic defaults.
Fail engine creation closed if operating-system entropy is unavailable.

The actual C-ABI regression repeats dependency RNG state: credentials repeat
before the repair; all twelve engine cases pass afterward. The existing locked
getrandom package owns the platform entropy call; no resolved packages,
configuration, database schema, or Gateway protocol are added.

* test(qa): follow canonical ClawHub documentation ownership

* test(ios): retain websocket frames across receive registration

* test(qa): align Watch branch with landed documentation reference

* test(ios): include websocket regressions in selected lifecycle suite

* fix(watchos): remove unused audio startup result

Remove the unused audio-format result through the audio, media-session and controller path. Periphery exposed obsolete fields in a value the sole caller discarded; activation, cancellation and codec policy stay unchanged.

Include the separately reviewed Apple fixture synchronization fixes from #138207 while that prerequisite lands. No Gateway runtime, protocol, configuration or persistence changes.

* chore(watch): sync landed CI prerequisites

Reuse the canonical startup baseline from #138449, terminal-parent QA
acknowledgment from #137342, and handle-scoped reclamation fixture from
#138481. Keep the Watch, Rust and Gateway/provider production sources
unchanged from the verified 907 native and real-provider checkpoint.

The four-file delta has a clean independent review. Source binding retains
all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and
baseline proof remain source-specific. No required check, timeout or size
allowance is disabled.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): compose device reply ownership with watch voice teardown

Use the canonical committed-mutation response owner from #138492 for device
remove, rotate and revoke, preserving immediate fencing and scoped teardown.
Include the separately reviewed #138625 cleanup fix so a retired caller cannot
skip removed-device worker reconciliation. Keep setup/bootstrap on their
existing retirement helper and retain the Watch HTTP invalidation owner.

Validation: 194 owner, Watch and authorization tests passed with zero skips;
fresh scoped managed review found no P0-P3 findings. Full changed checks and
new published-head native/Gateway live proof remain separate landing gates.

* test(watch): isolate platform metadata regressions

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
* feat(watch): add native standalone realtime voice

Add opt-in Talk on Watch with provider-direct WebRTC/Opus, scoped Gateway
control and explicit call/audio ownership. Preserve phone-mediated voice.

Resolve native endpoints consistently across ICE and Network.framework,
fence late resolver/media work after cancellation, and release received
Opus promptly after packet loss while dropping late speech. Keep recoverable
provider notices visible without closing the session; make setup actionable.

Source review passes all eleven sections through P3. Native engine RED/GREEN
passes eleven final cases; real Watch Simulator resolver classification and
held-result cancellation pass fifteen and sixteen cases respectively.
Full device/provider/current-base CI verification remains a landing gate.

Uses the already-landed app-local companion journal; adds no database schema
or protocol-version change. Physical Watch microphone/speaker, background
and endurance behavior remains unverified.

* fix(watch): use OS entropy for ICE credentials

Supply fresh ICE credentials through the native engine's existing owner API
instead of relying on the pinned library's non-cryptographic defaults.
Fail engine creation closed if operating-system entropy is unavailable.

The actual C-ABI regression repeats dependency RNG state: credentials repeat
before the repair; all twelve engine cases pass afterward. The existing locked
getrandom package owns the platform entropy call; no resolved packages,
configuration, database schema, or Gateway protocol are added.

* test(qa): follow canonical ClawHub documentation ownership

* test(ios): retain websocket frames across receive registration

* test(qa): align Watch branch with landed documentation reference

* test(ios): include websocket regressions in selected lifecycle suite

* fix(watchos): remove unused audio startup result

Remove the unused audio-format result through the audio, media-session and controller path. Periphery exposed obsolete fields in a value the sole caller discarded; activation, cancellation and codec policy stay unchanged.

Include the separately reviewed Apple fixture synchronization fixes from openclaw#138207 while that prerequisite lands. No Gateway runtime, protocol, configuration or persistence changes.

* chore(watch): sync landed CI prerequisites

Reuse the canonical startup baseline from openclaw#138449, terminal-parent QA
acknowledgment from openclaw#137342, and handle-scoped reclamation fixture from
openclaw#138481. Keep the Watch, Rust and Gateway/provider production sources
unchanged from the verified 907 native and real-provider checkpoint.

The four-file delta has a clean independent review. Source binding retains
all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and
baseline proof remain source-specific. No required check, timeout or size
allowance is disabled.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): compose device reply ownership with watch voice teardown

Use the canonical committed-mutation response owner from openclaw#138492 for device
remove, rotate and revoke, preserving immediate fencing and scoped teardown.
Include the separately reviewed openclaw#138625 cleanup fix so a retired caller cannot
skip removed-device worker reconciliation. Keep setup/bootstrap on their
existing retirement helper and retain the Watch HTTP invalidation owner.

Validation: 194 owner, Watch and authorization tests passed with zero skips;
fresh scoped managed review found no P0-P3 findings. Full changed checks and
new published-head native/Gateway live proof remain separate landing gates.

* test(watch): isolate platform metadata regressions

---------

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

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant