Skip to content

perf(state): preserve database witnesses across managed restarts - #159753

Merged
steipete merged 7 commits into
mainfrom
steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919
Sep 27, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Managed SIGTERM restarts could lose the clean agent-database witness and repeat an expensive admission scan. The full table-timing array also hid the slowest tables when console metadata was truncated.

User Impact

Same-version restarts can reuse the witness after successful checkpointing and final writer closure. The requested active-run drain stays unchanged; cleanup can use the remaining native service-stop budget. Crashes, failed closes, foreign ownership, and file/version replacement retain their admission checks. No configuration, schema, or stored user-data changes.

Why This Change Was Made

Two paths prevented certification: a supervised restart shortened its known stop deadline to the requested drain plus ten seconds, and a healthy reader-blocked checkpoint deleted the verification row that a later successful last writer needed to certify.

The stop-budget owner now keeps the native deadline for external SIGTERM restarts. The verification owner retains a dirty row after healthy incomplete checkpoints; only the existing last-lease checkpoint/close path marks it clean. Admission diagnostics distinguish stale leases, matching dirty receipts, and other invalidation. Deadline logs describe incomplete cleanup even when the supervisor requires exit status zero. Timing summaries report the ten slowest tables plus complete counts and elapsed totals per check kind. Production delta: +58 net lines.

Evidence

Blacksmith Testbox, profile openclaw-check:

  • tbx_01m3hjttenszx5d3cvr7n3gtct: same 64 MiB fixture, three cold admissions after pinned-reader eviction and final checkpointed close. Baseline validation 12.90–15.15 ms, median 13.86 ms, missing witness, table gate. Candidate 5.22–6.23 ms, median 6.11 ms, clean witness, cached admission (56% lower median). A real child killed with SIGKILL still ran the table gate: 14.89 ms, reason stale-lease.
  • tbx_01m3hknbrr4mq7q51rvzt7hrc6: real Gateway startup, persisted restart intent, SIGTERM handler, active reply cancellation, registered server close, resource drain, SQLite checkpoint/close, and cold cached reopen. With a 30-second drain and 90-second native timeout, the original code recorded forced_stop at 40 seconds; the repair completes cleanup at 45 seconds and records only planned_restart.
  • The pinned-WAL and 73-table diagnostic regressions failed on the original behavior. The diagnostic case places the expensive transcript check last and verifies it appears first in the bounded summary while totals include all 73 tables.

Primary validation on tbx_01m3hnz8a3km41tvemd6befq06 (workflow): node scripts/check-changed.mjs --base b1935b05e8814792587d26e5f1a770f38737ab9f passed core types, all 25 selected test graphs, lint, formatting, and guards. 336 focused tests passed across Gateway close, run-loop, shutdown budget, integrity, integrity worker, admission cache/policy/timing, lease, and quarantine suites. Changed source inputs were hash-verified.

Latest refreshed-base validation on tbx_01m3j7tnr5b0n0a7qcgathg8kb: the original 12-file Codex group passed 89/89; the three corrected files passed individually; the Gateway close, native writer-close, integrity diagnostic, admission timing, and real-child process-ownership replay passed 65/65 in 69.21 s. node scripts/check-changed.mjs --base HEAD -- <three corrected Codex tests> passed the scoped static gate, including extension test types, formatting, guards, export checks, and lint. The combined command took 547.48 s; the lease is stopped. All 19 changed files plus the two relevant Codex production owners were hash-verified. Missing dependencies were installed once with pnpm install --frozen-lockfile on the lease.

CI repairs and upstream reconciliation

CI exposed stale test expectations in addition to the witness change. The subagent regression now checks ended-scope rejection at the actual row readers; readiness probes intentionally return unavailable. On tbx_01m3hvvfs5bq9ekh4nh7gg7010, the original 79-file shard reproduced 1 failed / 1,053 passed, then passed 1,054/1,054. Native-worker blocked-checkpoint cases now require clean_close=0, with the final writer required to publish clean_close=1; all 22 cases passed on tbx_01m3hygy9krx7tdr7cdsa3fj7b.

Main owns the malformed PNG correction in #159771 and the media/ACP type repairs in #159836; duplicate task commits were removed. Concurrent #159852 changed non-sandbox Codex fixtures to expect source-owned cleanup, while #159841 restored native terminal cleanup outside sandbox process admission. Their combination produced five failures in CI run 36345413499. This PR reconciles those three tests with the actual execution-mode contract: native list/terminate/confirmation outside the sandbox, concrete source-owned process cleanup inside it. It preserves exact-turn confirmation, joined cleanup, propagated failures, activation cleanup, and Computer Use cancellation. The unchanged real-child suite protects independent sandbox work. No additional Codex production change remains in this PR.

The next CI run exposed one artifact-selector case left behind by Task retirement. Upstream #159819 (14ef6ab47832) removes only that retired taskId expectation; supported run/session selectors and disclosure checks remain covered. On Blacksmith Testbox tbx_01m3j9jksb9yccryfyh04ym788, the original Gateway-methods group reproduced 1 failed / 971 passed / 2 skipped, then passed 972 / 2 skipped, followed by 70/70 in its isolated configuration with the exact upstream patch. The focused file passed 10/10 in 23.04 s; explicit-file changed checks passed types, formatting, guards, export checks, and lint. The complete comparison/check command took 700.87 s; the lease is stopped, and fresh P2 review was scoped-clean.

The full compact-large-6 bundle then exposed a stale restart-status assertion after its artifact group passed. Upstream b459eb600f23 restores the table-defined interrupted/running expectation after Task retirement changed the status reader. On Blacksmith Testbox tbx_01m3jbnam8zzr2mqp4cx4n9ye2, the original 77-file group reproduced 4 failed / 1,004 passed. With the exact upstream patch, the entire original four-group bundle passed 2,639 tests / 2 existing skips, including the two groups previously hidden by fail-fast. The focused restart file passed 27/27 in 45.65 s, and explicit-file changed checks passed types, lint, formatting, guards, and export checks. The comparison plus full proof took 926.20 s. Fresh P2 review was scoped-clean, and the lease is stopped. This adds no production behavior, cases, fixtures, or delays; the existing restart file includes real SQLite persistence, lifecycle rotation, and cold restoration, with 56% of its focused Vitest duration spent in transformation.

The resident catalog benchmark exposed one timing-dependent CI failure (catalog_pending) after the earlier groups passed. Its existing hydration-completion wait occurred after the first bounded requests. The test now joins that same persisted-snapshot signal before its first request and reuses the namespace later; production deadlines, measured hot calls, and all I/O/CPU assertions remain unchanged. The exact failing list call could not be identified from the redacted CI stack, and the original 19-file Testbox replay passed, so that replay alone is not claimed as a fix.

On Blacksmith Testbox tbx_01m3jdse4q3cjt9ttmq0rpddpq, a temporary cold-start fault accelerated the response deadline only while the actual hydration marker was pending: the original ordering failed with the same catalog_pending error and the candidate passed. Instrumentation was then removed and production/test hashes verified. The uninstrumented candidate passed 20/20 focused runs (single-worker command median 29.82 s, range 26.59–34.16 s), 3/3 original 19-file shard runs with 259 tests each (148.93 / 151.67 / 156.87 s), 12 catalog-budget tests, and scoped changed checks. The final stability/check command took 1,400.58 s. Fresh P2 review was scoped-clean; the lease is stopped.

The database-related commits are patch-identical across the final base refresh (git range-diff). Independent Codex reviews were scoped-clean through P2 for the production change and earlier CI repairs; the final three-test reconciliation also passed fresh P2 review.

Test cost

Single-worker command wall time (pnpm test <file> --maxWorkers=1), measured remotely:

Test file Seconds
src/gateway/server-close.agent-databases.test.ts 40.02 cold; 17.11 warm
src/cli/gateway-cli/run-loop.test.ts 34.53
src/infra/sqlite-integrity.test.ts 2.34
src/state/openclaw-agent-db.integrity-cache.test.ts 8.34
src/state/openclaw-agent-db.integrity-policy.test.ts 7.16
src/state/openclaw-agent-db.open-timing.test.ts 6.86
src/agents/subagents/registry/subagent-registry-state.async.test.ts 20.97
src/state/openclaw-agent-execution.integrity.test.ts 14.14
extensions/codex/src/app-server/run-attempt-thread-cleanup.test.ts 29.33
extensions/codex/src/app-server/run-attempt.activation.test.ts 22.19
extensions/codex/src/app-server/run-attempt.computer-use.test.ts 21.32
src/gateway/server-methods/artifacts-session-resolution.test.ts 23.04
src/agents/subagents/registry/subagent-orphan-recovery.restart-integration.test.ts 45.65
src/gateway/server-methods/session-catalog.performance.test.ts 29.82 median (20 runs)

Gateway and CLI coverage retain real lifecycle/process boundaries; command wall time includes worker/module transformation. The new managed-restart case replaces an existing case, uses a controlled clock, and took 1.66 s. A same-lease warm-cache comparison of the original and updated Gateway test file on identical final production code measured 17.68 → 17.11 s, with all four tests passing. Final CI run 36355972726 passed on exact head ec600543ac321e90d4fe8f8e725f47936eae171d: 129 successful jobs, 19 skipped jobs, and openclaw/ci-gate green. Job wall times, including setup and all tests in each bundle: Linux compact-large-6 414 s, Codex bundle-13 255 s, Windows shard-4 272 s. These are job costs, not per-file estimates. The PR merged as 0722b96fe87a7b03e4b089caacdfeaec175f9852 after validation.

Limits

The Gateway fixture controls time, the systemd timeout response, and the process-exit callback; it does not run a real systemd unit. The benchmark uses 1,024 synthetic 64 KiB rows. Production-scale restart latency, the live Gateway, and a published-package upgrade were not tested.

An earlier broader storage replay produced 1 failed / 1,274 passed / 1 skipped across 69 available files; two moving-base files were unavailable. Standalone state-migrations.caller-mode.plugin-execution.test.ts produced 2 failed / 21 passed. Diagnostic replay identified plugin lifecycle lease core:plugin-lifecycle/global was lost in indexed post-session-repair cells. No safe migration repair was established here, and no migration assertions or authority checks were relaxed. Completed unbrokered background-source revocation received no new OS-settlement proof in this lane.

@clawsweeper

clawsweeper Bot commented Sep 27, 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 docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes size: M labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 15:34
@steipete
steipete enabled auto-merge (squash) September 27, 2026 15:39
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 27, 2026, 5:46 PM ET / 21:46 UTC (Revision 9).

ClawSweeper review

What this changes

The branch preserves native stop time during supervised restarts, retains a dirty database verification receipt for later certification, bounds integrity timing logs, and updates related tests and docs.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: current main still has the reported restart behavior. The runtime repair is well supported, but its durable recovery contract lacks recorded maintainer acceptance and copied-state upgrade proof.

Priority: P2
Reviewed head: 85a512144140e91923a79f134ae1ab018716a5f2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The runtime boundary proof is strong and no discrete code defect was found, but the durable recovery change remains unaccepted and unproven across upgrades.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The PR body records a Testbox Gateway restart through the changed shutdown and database-close owners: with a 30-second drain and 90-second native budget, cleanup completed at 45 seconds, recorded planned_restart, and reopened from a clean receipt; a real-child SIGKILL still selected the table gate. Published-driver upgrade and rollback were not exercised, so stored-data compatibility remains insufficient.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The PR body records a Testbox Gateway restart through the changed shutdown and database-close owners: with a 30-second drain and 90-second native budget, cleanup completed at 45 seconds, recorded planned_restart, and reopened from a clean receipt; a real-child SIGKILL still selected the table gate. Published-driver upgrade and rollback were not exercised, so stored-data compatibility remains insufficient.
Evidence reviewed 12 items Introduced persistent behavior: The introduced branch updates a verification row to clean_close=0 after a blocked checkpoint where current main deletes it.
Current main still deletes the receipt: The main-branch invalidation path deletes the verification row, so the central retention change is still useful.
Shutdown deadline: The branch lets an externally supervised restart use the remaining native stop budget after the shorter active-run drain.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Gateway drains active work and closes SQLite databases during a managed restart. On startup, database admission uses a persisted verification receipt to decide whether an expensive integrity gate is needed.

flowchart LR
A[Managed restart] --> B[Active work drain]
B --> C[Close database writers]
C --> D{Checkpoint completed?}
D -->|Yes| E[Clean receipt]
D -->|No| F[Dirty receipt]
E --> G[Cached startup admission]
F --> H[Integrity scan]
Loading

Decision needed

Question Recommendation
Should a reader-blocked close retain a dirty quarantine-store verification row so a later final writer can certify it across managed restarts? Accept retained dirty receipts: Record the retention, rollback, and recovery contract after copied-state upgrade proof, then retain the faster restart path.

Why: This changes durable retention and recovery semantics, which repository policy reserves for recorded maintainer acceptance; runtime benchmark results cannot decide that contract.

Before merge

  • Resolve merge risk (P1) - A healthy reader-blocked close now retains a durable dirty verification row. The discussion does not record the storage-policy acceptance required for its retention and recovery contract.
  • Resolve merge risk (P1) - The PR has not shown copied-state upgrade, rollback, and re-upgrade through the published v2026.9.6 driver; the same-version receipt and recovery behavior therefore remain unverified for existing installations.
  • Complete next step (P2) - Record maintainer acceptance of dirty-receipt retention and prove copied-state upgrade, rollback, and re-upgrade through the published v2026.9.6 driver before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +58, Tests +206, Docs +11. Total +275 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 6 98 40 +58
Tests 13 299 93 +206
Docs 2 19 8 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 416 141 +275

Review metrics

Metric Value Why it matters
Net code growth production +58, tests +206, docs +11 The production growth has a stated restart and diagnostic purpose; the retained-state portion still needs its compatibility decision.

Merge-risk options

Maintainer options:

  1. Prove and accept receipt retention (recommended)
    Run the published driver, candidate, rollback, and re-upgrade against copied existing state and link explicit storage-owner acceptance before merge.
  2. Narrow the persistent change
    If that recovery contract is not accepted, remove dirty-row retention and keep only the independently useful shutdown and diagnostic changes.

Technical review

Best possible solution:

Keep the native supervisor deadline and bounded diagnostics, and retain dirty receipts under an accepted recovery contract proven against copied released state.

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

Yes, as a controlled source-backed path: a managed SIGTERM restart with a 30-second drain and 90-second native deadline exposes the premature stop, while a reader-pinned checkpoint exposes lost certification. This read-only review did not execute current main.

Is this the best way to solve the issue?

Unclear overall. The owner-level shutdown and receipt changes fit the failure path, but retaining durable verification metadata needs an accepted recovery contract and released-state upgrade proof.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2c962c0d6701.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This addresses a bounded restart performance problem without evidence of an urgent user-facing outage.
  • merge-risk: 🚨 compatibility: Merging changes persisted verification-row retention and later certification during upgrades and recovery.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body records a Testbox Gateway restart through the changed shutdown and database-close owners: with a 30-second drain and 90-second native budget, cleanup completed at 45 seconds, recorded planned_restart, and reopened from a clean receipt; a real-child SIGKILL still selected the table gate. Published-driver upgrade and rollback were not exercised, so stored-data compatibility remains insufficient.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records a Testbox Gateway restart through the changed shutdown and database-close owners: with a 30-second drain and 90-second native budget, cleanup completed at 45 seconds, recorded planned_restart, and reopened from a clean receipt; a real-child SIGKILL still selected the table gate. Published-driver upgrade and rollback were not exercised, so stored-data compatibility remains insufficient.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

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

  • Demonstrate copied-state upgrade from v2026.9.6, incomplete-close recovery, rollback, and re-upgrade through the published driver.
  • Link explicit maintainer acceptance of the dirty-receipt retention and recovery contract.

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.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-27T15:40:47.711Z sha 2f50d80 :: blocked before merge. :: none
  • reviewed 2026-09-27T16:11:27.857Z sha c522c45 :: blocked before merge. :: none
  • reviewed 2026-09-27T17:00:48.599Z sha dd1aa58c7acc9108a1fb444bab0a6c78bcff942c :: blocked before merge. :: none
  • reviewed 2026-09-27T17:14:45.818Z sha b37c404f37578a5241f5a277a8932d6286b28cce :: blocked before merge. :: none
  • reviewed 2026-09-27T18:04:23.295Z sha 4db5efd3ffe7b353d7da348f4ecfb54f5a13f3e1 :: blocked before merge. :: none
  • reviewed 2026-09-27T19:04:02.166Z sha 55fe1b7365c252c9942319bb3945e82bded6762c :: blocked before merge. :: none
  • reviewed 2026-09-27T20:35:06.849Z sha b2c5097 :: blocked before merge. :: none
  • reviewed 2026-09-27T21:08:19.944Z sha cab8221 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Sep 27, 2026
@steipete
steipete force-pushed the steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919 branch from dd1aa58 to b37c404 Compare September 27, 2026 17:04
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 27, 2026
@steipete
steipete force-pushed the steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919 branch from 4db5efd to 55fe1b7 Compare September 27, 2026 18:56
Keep native SIGTERM stop time available for database cleanup and preserve dirty verification after reader-blocked checkpoints. Retain crash invalidation and log bounded table costs with explicit missing-proof reasons.
Reconcile the source-owned fixture changes in #159852 with the native cleanup mode correction in #159841. These fixtures run without sandbox process admission and must exercise native terminal cleanup, including joined settlement and RPC failure. Source-owned sandbox behavior remains covered by the unchanged real-child suite.
@steipete
steipete force-pushed the steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919 branch from 6102b74 to b2c5097 Compare September 27, 2026 20:26
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 27, 2026
…59819)

* fix: complete Task retirement test and harness cleanup

* test: finish retirement selector and async fixture cleanup

(cherry picked from commit 14ef6ab)
@clawsweeper clawsweeper Bot added the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Sep 27, 2026
@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 27, 2026
…ecovery

#159179 replaced the retired task-registry check (every unended run read as
"running") with resolveSubagentSessionStatus, which correctly reports unended
gateway-restart runs as "interrupted". Assert the session status matches the
non-terminal expected state, restoring the four interrupted cases on main.

(cherry picked from commit b459eb6)
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 27, 2026
Join the existing persisted-snapshot signal before the first bounded catalog request. Keep the native hydration, hot-path measurements, response deadline, and all performance assertions unchanged.
@steipete
steipete merged commit 0722b96 into main Sep 27, 2026
206 checks passed
@steipete
steipete deleted the steipete/perf-micro-gate-witness-on-deploy-shutdown-20260919 branch September 27, 2026 22:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…nclaw#159753)

* perf(state): preserve database witnesses across managed restarts

Keep native SIGTERM stop time available for database cleanup and preserve dirty verification after reader-blocked checkpoints. Retain crash invalidation and log bounded table costs with explicit missing-proof reasons.

* test(subagents): check expired scope rejection at row readers

* test(state): verify dirty receipts through native writer close

* test(codex): match cancellation proof to native execution mode

Reconcile the source-owned fixture changes in openclaw#159852 with the native cleanup mode correction in openclaw#159841. These fixtures run without sandbox process admission and must exercise native terminal cleanup, including joined settlement and RPC failure. Source-owned sandbox behavior remains covered by the unchanged real-child suite.

* fix: repair artifact and upgrade validation after Task retirement (openclaw#159819)

* fix: complete Task retirement test and harness cleanup

* test: finish retirement selector and async fixture cleanup

(cherry picked from commit fad8e39)

* fix(test): keep interrupted subagent restarts interrupted in orphan recovery

openclaw#159179 replaced the retired task-registry check (every unended run read as
"running") with resolveSubagentSessionStatus, which correctly reports unended
gateway-restart runs as "interrupted". Assert the session status matches the
non-terminal expected state, restoring the four interrupted cases on main.

(cherry picked from commit ea2fe01)

* test(gateway): await catalog hydration before resident benchmark

Join the existing persisted-snapshot signal before the first bounded catalog request. Keep the native hydration, hot-path measurements, response deadline, and all performance assertions unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes docs Improvements or additions to documentation extensions: codex gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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