Skip to content

perf(gateway): admit agent databases when the listener binds - #164670

Merged
steipete merged 5 commits into
mainfrom
steipete/perf-micro-restart-handoff-prod-evidence-20260919
Oct 4, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/perf-micro-restart-handoff-prod-evidence-20260919

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

After an unclean restart, agent databases can remain unavailable behind a full startup inspection before their writable owner checks the predecessor's lease. A late model publication can also make chat metadata unavailable after database recovery by retaining the expired preparation context.

User Impact

Current-schema agent databases begin native writable admission when the listener binds, independently of subagent restoration. Requests remain fenced until integrity validation and session/model preparation succeed. Metadata refreshes use the Gateway's lifetime and observe final admission, so recovered agents appear in metadata and model listings.

No configuration, schema, stored-data, update, rollback, or supervisor-budget changes are required. Valid clean-close receipts retain their fast path; migration, canary, Doctor, and artifact-preserving checks remain strict.

Why This Change Was Made

The reported cutover had 91 seconds between readiness and stale-owner detection, followed by a 22.104-second database open. Agent leases check PID/start identity when claimed; they have no expiration timer. The previous startup path could finish a full read-only integrity scan, wait for sidecars, and serialize behind other agents before claiming that lease and validating again.

Runtime inspection now checks compatibility and ownership and transfers physical validation to the existing native writable owner. At most two databases open concurrently; secrets/model publication remains serialized through its final admission commit. Authority, deletion, cancellation, and worker-settlement checks remain in place.

The single writable gate retains full integrity_check and foreign_key_check. Partial table checks miss shared and orphaned pages, so their plan, batching, and timing machinery are removed. Clean proof still requires matching physical identity, application version, ownership, schema/indexes, and certified release. Production TypeScript delta: +32 LOC (261 added, 229 removed). The requested exclusion-based count is +75 LOC (308 added, 233 removed), including the shared test-instance helper and one wrapper inventory line. The partial-table planner and duplicate scan are deleted; growth preserves bounded native admission separately from serialized model/secrets publication, Gateway-owned metadata refresh, and configured owner/path eligibility.

Evidence

A process-cold Linux rig used identical synthetic dirty snapshots, the real built Gateway, native chat.inject writes, a killed real lease owner, and no worker preload. The first usable session result had to contain the complete seeded inventory; an empty successful listing was rejected as availability proof.

Measurement Before After
512 MiB seeded transcripts: all 129 sessions available 35.471 s 31.751 s
Stale-owner detection after actual listener bind 6.089 s 2.187 s
Integrity and foreign-key gate 7.877 s, partial checks 7.936 s, full check
chat.metadata 20 seconds after recovery UNAVAILABLE, expired preparation scope healthy
128 MiB: all 33 sessions available 24.548 s 25.528 s

The 512 MiB payload fixture produced a 1,585,381,376-byte main database plus a 67,108,864-byte WAL.

Normalized journal/RPC excerpts from process spawn:

before +23.831s stale lease: owner-pid-dead; previous release not observed
before +34.327s recovered after background inspection and preparation
before +55.696s chat.metadata: UNAVAILABLE (Agent database preparation has ended: main)
 after +16.561s stale lease: owner-pid-dead; previous release not observed
 after +30.466s recovered after background inspection and preparation
 after +52.015s chat.metadata: success

The comparable-load large-state cell improves usable admission by 3.720 seconds / 10.5%. The small-state sample is 0.980 seconds slower; this is not a universal boot-time speedup. Another valid large baseline took 50.479 seconds under higher load and is excluded from the improvement claim. OS caches were not flushed. The rig pins base 74db989c268c and measured the runtime published at 9f7dbd92. Later fixture/eligibility repairs and the current-main rebase were not rebenchmarked; these numbers remain evidence for that measured revision.

Earlier measured candidate: 9f7dbd928dee44c2fc9407ee8d95f7b729ef856c; its original rebase preserved all 27 reviewed/tested file hashes.

Testbox provider blacksmith-testbox, lease tbx_01m4253ma1srfjptmtc99nap3t:

  • 110 focused startup, integrity, and preflight tests across nine files passed with node scripts/run-vitest.mjs <focused files> --maxWorkers=1: 146.28 seconds across four shards. Gateway startup: 12 cases, 103.58 seconds.
  • The listener/handoff regression fails against the original source because preflight enters its duplicate full scan. Both real page-corruption regressions fail against the original admission modules because admission resolves instead of rejecting; candidate passes. Every source variant is restored and hash-verified.
  • Metadata runtime/shutdown and startup siblings passed. The complete metadata boundary file passes in 10.62 seconds (wrapper 12.25 seconds); the existing shared-Gateway test including the new flow takes 198 ms. Original metadata owners reproduce the exact expired-preparation UNAVAILABLE error in 22.97 seconds. The fixture retains one Gateway/test lifetime because the global test cleanup retires publication listeners between tests.
  • Initial 24-file staged gate passed on the authorized Linux rig fallback at base 74db989c268c: node scripts/check-changed.mjs --staged; 27 core test graphs, lint (23 files, zero warnings/errors), dead-code scans, import-cycle and database guards passed. Core test types totaled 2,194.9 seconds; complete gate took about 57 minutes. The earlier Testbox had queued for 66 minutes and disappeared. Metadata increment gate on the lease above passed in 22m48.354s: all 27 typecheck groups, lint (three files, zero warnings/errors), dead-code scans and remaining guards passed.
  • Maintained sourcePerformance runtime build passes. Fresh independent review of the complete combined change is clean through P2.

Expected next-cutover journal: an unclean predecessor's agent database stale lease: owner-pid-dead; previous release not observed should follow listener bind without waiting for a separate full scan or subagent restoration. Dirty admission reports integrityGateMode=full, followed by agent database recovered after background inspection and preparation. A valid receipt should retain cached admission. Verify complete session inventory and metadata/model RPCs after recovery, including delayed publications.

This is successor-side evidence. The shutdown rig held three model calls, background exec, a PTY, and real worker leases, but the original code still wrote its receipt and closed agent databases by 46.456 seconds. It did not reproduce the missing predecessor receipt. The independent shutdown partial-close change is separate. The rig does not reproduce the production 91-second interval exactly; the next production cutover remains the acceptance check. No live Gateway or deployer was modified.

Rebase validation (lane 407)

Candidate 2c0db987677fdc9b2ae6f7e7ff700d9fbf267a34: the original three commits and two focused gate/fixture repairs, rebased onto 3052e3b93a0ad587589e6dcb2d7f6b44d97a1189. A focused follow-up keeps metadata refresh in its owner context and satisfies the current line-cap gate. The listener-time activation and sidecar preparation barrier remain intact. Main's direct-import simplification, close/canary guards, and independence from subagent restoration are preserved. Main already fixes the outbound fixture's state-root mismatch explicitly, so the obsolete ambient stub and diagnostic-only assertion messages were removed from this PR.

The current-main line-cap ratchet rejected the four-line growth in chat-metadata-runtime.ts (714 → 718 counted lines). Its unchanged ACP session reader now lives in the existing session-projection module, with all three callers using that owner. Lint separately enforced the absolute cap at 703 lines, so AsyncLocalStorage.bind now owns the refresh context directly, removing the snapshot/per-call wrapper. The runtime meets the 700-line cap; the follow-up is net −2 production lines, with no duplicate helper or baseline exception.

Fresh proof uses blacksmith-testbox, profile openclaw-check, lease tbx_01m42hj2def4hhxca2m77z3ma0. Testbox's shallow seed initially retained a newer Git HEAD despite syncing source. The exact three-commit candidate was imported through a Git bundle, the complete tracked tree was compared, and pnpm install --frozen-lockfile passed before any test ran. Source hashes were verified before every proof command.

  • The nine startup/preflight/integrity files passed 113 tests; Gateway startup passed all 12 cases in 101.45 seconds, including admission while subagent restoration remains held. The metadata and CI-fixture siblings passed 197 tests across eight files. Combined command: 310 tests across 17 files, 307.311 seconds on the lease.
  • Original-code negative controls were rerun on the same lease. The listener/handoff case failed at the duplicate read-only scan assertion (30.47 seconds), and both real page-corruption cases failed because admission resolved instead of rejecting (17.29 seconds). The comparison command succeeded in 56.080 seconds; exact candidate bytes and modes were restored and hashes verified after each variant.
  • After the final context-binding simplification, the full metadata boundary/runtime/shutdown/native-session selection passed 50 tests across four files, Vitest 31.30 seconds, wrapper 33.73 seconds, complete remote command including worker preparation 118.674 seconds. The preceding extraction-only rerun also passed all 50 tests (115.707 seconds).
  • Fresh independent review of the complete final staged candidate is scoped-clean through P2. Targeted lint of both metadata owners passed with zero warnings/errors (9.0 seconds lint, 114.657 seconds including declaration preparation). The first full gate passed production types, all 27 core and four root test type graphs, and dead-export checks, then stopped on the 703-line lint failure (1466.042 seconds). The repeated gate lost its runner with exit 255 during test typechecks; GitHub confirms its Testbox workflow was cancelled, with no compiler/test diagnostic. A replacement queued beyond 20 minutes, so the final complete staged gate ran through the authorized Linux rig fallback on openclaw-node-01, lane lane407-rebase-164670. nohup bash /srv/rig/rig-staged-check.sh lane407-rebase-164670 db01dc3de693569e7cc8a6b1fb8ab2bdbc578c31 ran node scripts/check-changed.mjs --staged with the full candidate patch. It finished with exit=0, approximately 54 minutes (05:36–06:30 UTC). The full 35-file staged tree was verified before and after as 6f39c44036740c729162bac1fe0851881e243814, identical to the tested 22c1d69ab1de commit tree.

The replacement blacksmith-testbox lease tbx_01m42ndhnnfeppgjnrb36jhwfx eventually became ready and reran test/scripts/eager-import-closure.test.ts against the final staged tree: 17 tests passed, Vitest 15.65 seconds, wrapper 16.42 seconds, complete remote command including source materialization/install 70.513 seconds.

Commands use node scripts/run-vitest.mjs <focused files> --maxWorkers=1 and node scripts/check-changed.mjs --staged --base db01dc3de693569e7cc8a6b1fb8ab2bdbc578c31. No heavy validation ran on the Mac. The earlier benchmark values above were not remeasured by this rebase, and production cutover acceptance remains outstanding.

Focused rerun commands
node scripts/run-vitest.mjs \
  src/gateway/server-agent-database-startup.test.ts \
  src/state/openclaw-database-preflight-agent-scheduler.test.ts \
  src/state/openclaw-database-preflight.startup-prepared.test.ts \
  src/state/openclaw-agent-schema-inspection-worker.test.ts \
  src/infra/sqlite-integrity.test.ts \
  src/infra/sqlite-integrity-worker.test.ts \
  src/infra/sqlite-index-schema.test.ts \
  src/state/openclaw-agent-db.integrity-cache.test.ts \
  src/state/openclaw-agent-db.open-timing.test.ts --maxWorkers=1

node scripts/run-vitest.mjs \
  src/gateway/server.chat-metadata-boundary.test.ts \
  src/gateway/server-methods/chat-metadata-runtime.test.ts \
  src/gateway/server-methods/chat-metadata-runtime.shutdown.test.ts \
  src/infra/outbound/delivery-queue.recovery.test.ts \
  src/commands/doctor-config-preflight.container-upgrade.test.ts \
  test/scripts/eager-import-closure.test.ts \
  test/helpers/openclaw-test-instance.test.ts \
  test/helpers/openclaw-test-instance.runtime.test.ts --maxWorkers=1

node scripts/run-vitest.mjs \
  src/gateway/server.chat-metadata-boundary.test.ts \
  src/gateway/server-methods/chat-metadata-runtime.test.ts \
  src/gateway/server-methods/chat-metadata-runtime.shutdown.test.ts \
  src/gateway/server-methods/chat-metadata-runtime.native-session.test.ts --maxWorkers=1

Negative controls retain candidate tests and substitute only pinned-base production owners, with exact restoration and source-hash verification. Handoff substitutes openclaw-agent-schema-inspection.ts and selects main follows its handoff. Integrity substitutes the original database/schema/index/integrity owners and selects refuses .* before admitting a dirty database.

Final rig gate results from the retained command log:

Check Result
Core production types Passed
Core test type graphs All 27 passed
Root test type graphs All four passed; 315.1 s total
Changed core lint 29 files; zero warnings/errors; 42.5 s
Script lint 1,309 files; zero warnings/errors; 51.8 s
Changed root test lint Four files; zero warnings/errors; 23.6 s
Dead exports Production, full-tree, and scripts: zero entries
Runtime import cycles Zero
Format, line-cap, database/schema, sidecar, webhook, and pairing guards Passed
Complete staged gate exit=0

Testbox workflow receipts: main focused proof (later cancelled during the repeated gate) and final eager-import proof. Their test successes above are command-level results; the cancelled workflow is not presented as a green aggregate run. Both task-owned leases were stopped.

CI follow-up

Run 37183170428 exposed two separate test-fixture failures:

  • checks-node-compact-small-5: two desktop-readiness proof fixtures supplied only a /readyz response after the shared test-instance owner began requiring /startupz settlement. One reused a consumed response body; the other exhausted its response queue and waited until its existing 60-second deadline. Both success fixtures now supply distinct, fresh startup responses. Every deadline, retry, redaction, and timing assertion remains unchanged; no production or shared-helper behavior changed.
  • checks-ui-e2e-real-gateway (2/2): the synthetic merge b82f27f9ba31 included main's provider-qualified Automations model values, while the existing test expected bare option IDs. The failure was the initial retiring assertion, before any publication. Main fixed all five selectors in 70fc9407fcfb; this branch incorporates that fix through a normal rebase, with no copied upstream production change or extra UI diff.

Fixture-only proof on blacksmith-testbox, lease tbx_01m42tedeby1qz9nrg7qqhe1we: node scripts/run-vitest.mjs test/scripts/desktop-readiness-proof.test.ts --maxWorkers=1 passed all four tests, Vitest 21.02 seconds, wrapper 23.14 seconds. node scripts/check-changed.mjs --staged also passed, including all four root test type graphs, dead exports, script lint, and changed-test lint (zero warnings/errors). Combined source materialization, install, test and gate command: 401.739 seconds. Independent fixture review was scoped-clean through P2; the lease was stopped before rebasing. The Testbox workflow receipt identifies this lease.

The final rebase onto 3052e3b93a0a is patch-identical across all five commits (git range-diff reports = for each). All previously tested PR runtime/test file hashes survived unchanged; only main's wrapper-inventory additions differ. Thus the completed behavioral proof is retained, while the inherited UI selector fix comes from its canonical main owner. Fresh independent review of the complete rebased candidate is scoped-clean through P2.

Final exact-head CI 37184663139 completed successfully for 2c0db987677fdc9b2ae6f7e7ff700d9fbf267a34; both openclaw/ci-gate projections are green. GitHub reports the PR merged at 2026-10-04 07:16:51 UTC as 3f6c1d3a23b90c52b3bf317afc5291e7f1125e32, verified on current main. All task-owned Testbox leases and the Linux rig worktree were cleaned up.

@clawsweeper

clawsweeper Bot commented Oct 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 docs Improvements or additions to documentation gateway Gateway runtime size: L labels Oct 4, 2026
@steipete
steipete enabled auto-merge (squash) October 4, 2026 01:33
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 3:09 AM ET / 07:09 UTC (Revision 4).

ClawSweeper review

What this changes

The PR begins bounded agent database admission when the Gateway listener binds, restores full integrity checks, and keeps recovered chat metadata refreshes within the Gateway lifetime.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main retains the earlier startup arrangement, and neither related PR supersedes this work. No actionable introduced defect was found, and the supplied runtime evidence supports the recovery behavior.

Priority: P2
Reviewed head: 2c0db987677fdc9b2ae6f7e7ff700d9fbf267a34

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent owner-level repairs have strong runtime evidence and no actionable finding; benchmark claims appropriately retain their measured-revision limits.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The built Linux Gateway exercised killed-owner recovery, native writes, complete session inventory, and delayed metadata RPCs through the changed startup owners. Earlier-revision timings remain explicitly scoped, with later boundary controls and fixture validation recorded; no stored-data contract changes require migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The built Linux Gateway exercised killed-owner recovery, native writes, complete session inventory, and delayed metadata RPCs through the changed startup owners. Earlier-revision timings remain explicitly scoped, with later boundary controls and fixture validation recorded; no stored-data contract changes require migration.
Evidence reviewed 10 items Pinned introduced changes: Reviewed the merge-base-to-head changes at the supplied identities. Base-only node-host and Control UI changes were excluded from PR ownership; the introduced changes cover startup admission, integrity validation, metadata lifetime, documentation, and supporting fixtures.
Admission ordering and fencing: Listener binding activates database admission. Native opening uses the existing write queue and execution owner, rechecks current configuration and startup ownership before granting worker requests, and releases its execution borrow. Model/secrets preparation still waits for sidecar readiness.
Complete admission before publication: Opening is limited to two concurrent databases. Preparation remains serialized through its final deletion-journal check and admission publication; stopped or superseded preparation retains refusal rather than admitting public requests.
Findings None None.
Security None None.

How this fits together

The Gateway checks agent databases before allowing session writes and model use. Startup admission connects database ownership and integrity validation to session preparation, readiness, and chat metadata.

flowchart TD
  A[Existing agent databases] --> B[Compatibility and ownership inspection]
  B --> C[Pending admission fence]
  D[Gateway listener binds] --> E[Bounded native database admission]
  C --> E
  E --> F[Full integrity validation]
  F --> G[Serialized session and model preparation]
  G --> H[Available agents and refreshed metadata]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +32, Tests +234, Docs -1, Other +1. Total +266 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 21 261 229 +32
Tests 13 401 167 +234
Docs 1 30 31 -1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 36 693 427 +266

Review metrics

Metric Value Why it matters
Production versus test growth production +32 LOC; tests +192 LOC; shared test support +42 LOC The PR explains production growth through bounded native admission, serialized publication, eligibility checks, and metadata ownership while removing partial-check machinery.

Technical review

Best possible solution:

Keep one native writable integrity gate, preserve pending-agent fences through preparation, and refresh metadata from its Gateway lifetime owner.

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

Yes: the supplied real Gateway before/after trace and source identify duplicate startup validation and delayed metadata publication under an expired preparation scope; this review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes: the patch moves validation to the existing writable owner and binds refresh to its existing lifecycle, with focused negative controls and no competing persistence owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5f656752e404.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves bounded restart recovery and repairs post-recovery metadata availability without evidence of an emergency current outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The built Linux Gateway exercised killed-owner recovery, native writes, complete session inventory, and delayed metadata RPCs through the changed startup owners. Earlier-revision timings remain explicitly scoped, with later boundary controls and fixture validation recorded; no stored-data contract changes require migration.
  • proof: sufficient: Contributor real behavior proof is sufficient. The built Linux Gateway exercised killed-owner recovery, native writes, complete session inventory, and delayed metadata RPCs through the changed startup owners. Earlier-revision timings remain explicitly scoped, with later boundary controls and fixture validation recorded; no stored-data contract changes require migration.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head changes at the supplied identities. Base-only node-host and Control UI changes were excluded from PR ownership; the introduced changes cover startup admission, integrity validation, metadata lifetime, documentation, and supporting fixtures. (2c0db987677f)
  • Admission ordering and fencing: Listener binding activates database admission. Native opening uses the existing write queue and execution owner, rechecks current configuration and startup ownership before granting worker requests, and releases its execution borrow. Model/secrets preparation still waits for sidecar readiness. (src/gateway/server-agent-database-startup.ts:47, 2c0db987677f)
  • Complete admission before publication: Opening is limited to two concurrent databases. Preparation remains serialized through its final deletion-journal check and admission publication; stopped or superseded preparation retains refusal rather than admitting public requests. (src/state/agent-database-startup.ts:331, 2c0db987677f)
  • Full integrity gate and corruption controls: Dirty writable admission now performs full integrity_check and foreign_key_check. Added real SQLite corruption cases demonstrate duplicate page ownership and orphan allocated pages that pass individual table checks but must reject admission. (src/state/openclaw-agent-db.integrity-cache.test.ts:163, 2c0db987677f)
  • Metadata lifetime repair: Refresh captures the metadata owner's creation context with AsyncLocalStorage.bind, and the lifecycle observes completed store-topology admission. The shared Gateway boundary regression checks chat.metadata and models.list after a delayed publication inherits an expired preparation borrow. (src/gateway/server-methods/chat-metadata-runtime.ts:355, 2c0db987677f)
  • Complete captured proof body: Recovered the omitted body tail through GitHub and verified the complete body's SHA-256 aa27bde018674b0b40070d856327151c6f968e2f6538794bfd277077c1acc909 and 16,983 UTF-16 units against the supplied snapshot. The Linux rig exercised the built Gateway, killed real lease owner, native chat.inject writes, complete seeded session inventory, and delayed metadata RPCs. It records 129 sessions becoming usable in 31.751 seconds versus 35.471 seconds, and successful metadata after recovery. These measurements belong to 9f7dbd928dee44c2fc9407ee8d95f7b729ef856c; later changes have focused boundary and fixture validation, not a new benchmark. (9f7dbd928dee)

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-04T01:35:59.796Z sha 9f7dbd928dee44c2fc9407ee8d95f7b729ef856c :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T02:54:55.710Z sha acd4af65574b80a925b9be1ee09d9ebb5ea3d4c0 :: needs changes before merge. :: none
  • reviewed 2026-10-04T06:40:44.159Z sha 22c1d69ab1dea5b7af3ba332d54dfb0a83748a7c :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts commands Command implementations size: XL and removed size: L labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Oct 4, 2026
@steipete
steipete force-pushed the steipete/perf-micro-restart-handoff-prod-evidence-20260919 branch from acd4af6 to 22c1d69 Compare October 4, 2026 06:33
Move current-schema physical validation from foreground inspection to the existing native writable owner. Start bounded admission independently of subagent restoration while keeping session, secrets, and model publication serialized and authority checked.

Retain one full integrity and foreign-key gate for dirty opens and remove partial table-check batching, which cannot detect shared or orphaned pages. Clean receipts retain the existing reuse path; strict canary, migration, and Doctor checks remain unchanged.
Refresh metadata in its Gateway lifecycle context and observe final agent admission. Late model catalog publications can then refresh recovered agents without inheriting an expired preparation borrow.

Extend the existing shared-Gateway boundary test to cover deferred admission and late publication while preserving projection and owner-failure behavior.
… for CI

Follow-up to the listener-time agent database admission: align the test-instance helper and preflight fixtures with the configured/historical ownership distinction, register the moved module in the PR-wrapper inventory, and keep the full integrity and foreign-key gate.
Move ACP session metadata preparation into the existing session-projection owner and bind refresh directly with AsyncLocalStorage.bind. Preserve the Gateway lifetime context while removing the per-call wrapper and keeping the runtime at the 700-line limit.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…w#164670)

* perf(gateway): begin agent database admission when the listener binds

Move current-schema physical validation from foreground inspection to the existing native writable owner. Start bounded admission independently of subagent restoration while keeping session, secrets, and model publication serialized and authority checked.

Retain one full integrity and foreign-key gate for dirty opens and remove partial table-check batching, which cannot detect shared or orphaned pages. Clean receipts retain the existing reuse path; strict canary, migration, and Doctor checks remain unchanged.

* fix(gateway): retain metadata ownership after database admission

Refresh metadata in its Gateway lifecycle context and observe final agent admission. Late model catalog publications can then refresh recovered agents without inheriting an expired preparation borrow.

Extend the existing shared-Gateway boundary test to cover deferred admission and late publication while preserving projection and owner-failure behavior.

* fix(gateway): repair startup admission fixtures and wrapper inventory for CI

Follow-up to the listener-time agent database admission: align the test-instance helper and preflight fixtures with the configured/historical ownership distinction, register the moved module in the PR-wrapper inventory, and keep the full integrity and foreign-key gate.

* fix(gateway): keep metadata runtime within its line cap

Move ACP session metadata preparation into the existing session-projection owner and bind refresh directly with AsyncLocalStorage.bind. Preserve the Gateway lifetime context while removing the per-call wrapper and keeping the runtime at the 700-line limit.

* test(gateway): supply settled startup responses in readiness proof
steipete added a commit that referenced this pull request Oct 5, 2026
Continue startup recovery when a pending agent database publishes its
successful admission. Reuse the existing recovery owner, original startup
cutoff, live authority checks, and serialized capacity. Limit subsequent
scans to the newly admitted agents while preserving fixed-store ownership.

This prevents an orphaned run from blocking new sends after SIGKILL.
Keep the original recovery timeout and add coverage for admission during
the first scan, after that scan, and after shutdown. Deferred dirty-store
admission in #164670 exposed the missing continuation reported in #165225.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Continue startup recovery when a pending agent database publishes its
successful admission. Reuse the existing recovery owner, original startup
cutoff, live authority checks, and serialized capacity. Limit subsequent
scans to the newly admitted agents while preserving fixed-store ownership.

This prevents an orphaned run from blocking new sends after SIGKILL.
Keep the original recovery timeout and add coverage for admission during
the first scan, after that scan, and after shutdown. Deferred dirty-store
admission in openclaw#164670 exposed the missing continuation reported in openclaw#165225.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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