Skip to content

perf(tts): carry prepared TTS preferences through dispatch - #164694

Merged
steipete merged 17 commits into
mainfrom
dbasync/ttsprepare
Oct 4, 2026
Merged

steipete merged 17 commits into
mainfrom
dbasync/ttsprepare

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Ordinary reply dispatch and prompt preparation repeatedly read the machine-owned tts.prefsPath on the Gateway thread. The local ten-turn fixture attributed 100 successful main-thread SQL statements to these TTS call chains: 40 row reads and 60 admission statements.

Why This Change Was Made

Read that fixed key through the existing shared-state read worker, then carry explicit present/absent facts through internal reply options, embedded/CLI prompt preparation, and delayed delivery callbacks. Each consumer retains its existing config/agent/channel/account/environment precedence and fresh preference-file reads. Standalone prompt, ACP, cron, and message-action preparation use the same reader.

The machine-state command branch now lives with its domain kernel. Two unchanged ACP prompt / CLI error helpers were extracted to satisfy the line-cap ratchet. No new worker service, policy cache, or OPENCLAW_* name was added.

User Impact

The measured TTS paths execute 10 → 0 main-thread statements per warmed turn, with one worker preference-row read per turn. This is a scoped reduction: the overall observed mean is 344.5 → 345.4 (median 338 → 330), not an aggregate reduction. Non-TTS paths executed 109 more warmed statements at unchanged session-entry, participant, and read-admission sites; the per-site accounting is below.

No schema, stored-data, retention, durability, config option, or update migration changes. Released synchronous TTS SDK calls remain supported with optional prepared facts, an explicit compatibility record, a next-major removal gate, and a compile-time contract test. No existing caller argument becomes required.

Evidence

Final integration

Candidate 4ebfcd375fe80a merges main 06d4475d6079aaa875a9b477ac0935d1459b1023, including the final schemafacts prerequisite (#164490, c828f7ed1d560295f78166a98fb54687dc162b28). The PR remains based on main; its diff against that captured main is 52 TTS-lane files, +426 / −63, with no prerequisite residue.

Conflict resolution preserves main's canonical buildConfiguredAgentSystemPrompt, tool normalization and inferred agent ID, while carrying prepared TTS facts through ordinary and compaction prompts. Compaction uses that canonical builder, and both storage-documentation paragraphs are retained.

The integrated candidate passed 130 tests across 11 files / six Vitest projects with --maxWorkers=1 on Node 24.21.0 (972.61 s wall). Coverage includes the real TTS read-worker/zero-caller-SQL boundary, worker settlement, TTS fallback behavior, canonical/embedded/CLI prompt builders, SDK compatibility, registry, shared-worker and reply import closures, and runtime process build graph. The dedicated wrapper-inventory case passed in 122.85 s wall. SDK type checking passed in 20.84 s; core production type checking passed in 139.51 s, including artifact-owner wait. Conflict-file lint, formatting, and git diff --check passed. Fresh P2 review against the captured main is scoped-clean.

The released SDK comparison against v2026.9.8 completed locally for correction 0f4e8b8 (2,091.91 s wall). The relevant public TTS owner/facade/signature files remain byte-identical after integration, so that report still covers this lane's signature changes. The full SDK compiler graph also passed in 36.6 s in earlier CI; that is whole-graph cost, not an isolated per-case timing. Per-file CI timings were unavailable in the retained artifacts. The type-only case takes 0 ms at runtime locally.

Exact-head CI run 37188231800 passed for 4ebfcd375fe80a341f644655fbfbac6fd6ad6d1d. ClawSweeper completed this head at 08:19 UTC on October 4 with no actionable introduced defect and confirmed the integration blocker is resolved. Its generic migration checklist item points to the static SDK compatibility-registry record; that record introduces no stored state, schema, or migration. Earlier heads’ results remain historical evidence.

Failure attribution and repairs

The original TTS truncation and cron exact-call fixtures were stale after prepared facts were introduced. Correction 0f4e8b8c31110668f7937fc3e929feda1978ffcf updates those inputs/expectations without weakening assertions, and adds the released-SDK record, type contract, docs, and wrapper inventory entry. Correction 6d94e4279faaf9433945f07e1ecaf92812993920 documents why the shared dispatch fixture isolates the real database worker; its exact mock ratchet failed before and passed afterward.

Inherited failures are now integrated from their owners: recovery fixture and retired Doctor-test inventory corrections in 1836ae2146443e (#164675), native formatter import repair in 3c0f7e4c5cdade, MCP cursor fixture correction in 42b9aee33a7b (#164795), and spinner-test repair in 65829ead96bb (#164465). The prerequisite also carries private-completion receipt settlement correction 395e837b023866. The latest pre-integration CI (37181377968, head b70ed5e) failed only the inherited spinner assertion and aggregate gate; every other executed job succeeded.

Attribution used 45 complete Linux file runs across the original PR, merge base, and pinned main. The later spinner failure reproduced in five complete E2E file runs on GitHub's actual tested merge and five on its exact main parent, each with only that assertion failing and two sibling cases passing; scheduled main CI independently matched. The cursor type error reproduced five times before its upstream correction superseded further repetitions. No sleeps, retries, timeouts, assertions, or baselines were weakened.

Loaded-Mac full declaration-fixture repetitions also hit unrelated compiler timeouts and are not counted as passing proof. The native-import defect has a real Node regression from main, and subsequent Windows CI passed. Original WebSocket 1006 fixture interruptions remain disclosed below; no transport fix is claimed.

Local SQL measurement

Before: cd69bcb581dfe35192d3f83b036844c88e3ce100 (main plus both prerequisite heads). After: bd25d971b8a0141c556fddb2c6fe8f956d704371. Node 24.21.0 / SQLite 3.53.4, source-map builds, fresh synthetic state, local streaming Responses fixture, real Gateway/WebSocket/storage paths. No external model service was called. Both completed workloads include 13 top-level turns, a successful child, cron completion, committed compaction, and clean [0, null] shutdown; all resolved disk database paths stayed within their fixtures.

The original native SQL observer and analyzer were reused unchanged. Counts include successful top-level SQL executions, including admission and transaction statements, and exclude prepares and failed attempts. The successful after run adds harness-only timestamps and passive ping/pong listeners after two interrupted attempts; workload, model, auth, RPC sequence, waits, deadlines, and SQL interception are unchanged. The inherited harness's hardcoded head field is not the source identity; use the pinned refs above.

Warmed turn Overall main before Overall main after TTS main before → after TTS worker row reads after
1 338 328 10 → 0 1
2 336 427 10 → 0 1
3 347 330 10 → 0 1
4 396 328 10 → 0 1
5 338 330 10 → 0 1
6 338 330 10 → 0 1
7 340 339 10 → 0 1
8 338 326 10 → 0 1
9 338 330 10 → 0 1
10 336 386 10 → 0 1
Total / mean 3,445 / 344.5 3,454 / 345.4 100 → 0 10
Phase Main before Main after TTS main before → after Worker before → after Helper before → after
Boot to ready 2,961 2,928 0 → 0 1,122 → 1,006 109 → 109
Connect / settle 6 44 0 → 0 228 → 275 0 → 0
New session / first chat 890 951 10 → 0 3,782 → 4,131 63 → 63
Ten warmed turns 3,445 3,454 100 → 0 13,537 → 13,030 220 → 208
Second session / parent + child 1,154 1,135 20 → 0 4,802 → 5,063 60 → 60
List / history / Inbox 0 0 0 → 0 57 → 57 0 → 0
Scheduled cron 455 455 0 → 0 2,298 → 2,304 10 → 10
Manual compaction 203 201 2 → 0 581 → 588 20 → 20
Graceful shutdown 402 404 0 → 0 2,049 → 2,062 0 → 0
Total 9,516 9,572 132 → 0 28,456 → 28,516 482 → 470

The preserved per-site analysis accounts for the aggregate +9 entirely: −100 TTS statements +109 at unchanged non-TTS sites. The original raw fixtures were removed after measurement; this audit reuses the recorded analyzer output and independently traces the current reader implementation.

Other warmed main-thread SQL site Before After Delta
session-accessor.sqlite-entry-read.ts:123 150 183 +33
session-accessor.sqlite-participant-projection.ts:56 460 493 +33
openclaw-agent-db-readonly.ts:118 502 533 +31
openclaw-state-db-cache.admission.ts:53 116 131 +15
session-accessor.sqlite-entry-read.ts:348 30 28 −2
agent-deletion-journal.ts:123 2 1 −1
Other machine-state read (line moved 27 → 62) 1 1 0

All nonzero non-TTS site changes are accounted for. The five unchanged files above have an empty before/after diff. Stack attribution places all 33 additional canonical session reads in existing chat/session authorization and pending-input paths, without TTS frames. Eight of ten overall turn counts decrease; the increases concentrate in turns 2 and 10, consistent with timing-dependent work within phase windows.

The integrated TTS reader does not replace its removed SQL with host admission SQL: openclaw-state-read-operation.ts retains the handle through retainOpenClawStateDatabaseForIndependentRead; openclaw-state-db-borrow.ts reads the cached-handle map directly without cacheAdmission.refresh. Host admission uses in-memory generations and filesystem identity; schema admission and the preference-row query run inside the worker. Explicit prepared absence ({}) prevents the synchronous SDK fallback. The evidence supports ten fewer main-thread statements in this path per turn, while no aggregate or latency improvement is claimed.

These are phase windows, including concurrent admission and maintenance, not causal RPC counts or latency measurements. Before had one failed main-thread and two failed off-main native attempts; after had two and three, respectively, excluded from the successful-statement totals.

Two initial after attempts ended with WebSocket 1006 / EPIPE after long gaps, before the next TTS preparation. They are excluded from the tables. The diagnostic run completed without a code change; it does not establish a fix for those transport interruptions. Those transport interruptions remain an unresolved fixture risk.

Original lane checks

All selected tests used --maxWorkers=1.

Check Result / wall time
Regression negative control with original TTS consumers Both new cases failed for caller SQL / synchronous fallback; 153.40 s
Focused TTS config/status, streaming, ACP delivery, system-prompt tests 127 passed; 267.63 s
Broad import-closure sweep plus SQL/streaming rechecks 44 passed; 493.89 s
Final shared-registry gates: runtime-process build graph, state-worker imports, get-reply imports, TTS SQL boundary, node-host reader 27 passed; 602.52 s
Targeted CLI isolated completion and ACP prompt/cancellation routes 5 selected passed, 197 unselected; 1,013.12 s
node scripts/check-changed.mjs -- <changed paths> Passed, including core and all selected test type graphs; 2,898.88 s
Madge 0 cycles; 144.19 s
Database-worker ratchet against 89c984736562959b3e6160dc118d4b84e18aabe6 No T1 call-count growth; 42.61 s
Released SDK diff, v2026.9.8 → lane commit, local realpath TMPDIR Completed; 2,208.47 s. Wider SDK changes/removals are inherited, not introduced by this lane.
P2 Codex autoreview against pinned merge base Scoped-clean; no accepted/actionable P0–P2 findings
Built after fixture Passed; 1,241.26 s including artifact-lock wait
Complete diagnostic SQL workload Passed; 268.50 s

The new worker boundary file took 1.63 s of test execution initially and 6.86 s on the loaded final run; it uses the real native reader to prove zero caller SQL, fresh next-turn facts, and prepared absence. Wall times above include substantial compilation/import/ownership waits on the loaded host. The historical CI failures and their corrections are recorded above; final integration checks are separate from these original receipts. The first changed-gate attempts exposed real line-cap growth; the helper extractions resolved it without exceptions.

Overlap discovery used the local archive and bounded live searches for PRs updated since October 1. Related independent work includes #162433 (standing inactive umbrella), #134617 (command history), #127091 (other-goal prompt forwarding), #127653 (import cleanup), and CLI cleanup/tests #164320 / #164520. Minimal propagation hunks preserve those areas' ownership. No production Gateway was changed or restarted.

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.
Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.
Integrate the pinned measurement baseline and retain main-key facts through the existing connection and reader-admission owners. Preserve raw writes, foreign commits, transaction snapshots, authorizers, and continuation authority.
Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.
Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.
Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.
Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.
Integrate the released-SDK diff tooling fix and the inherited child-coordination fixture correction. The merge preserves every authored source, test, and documentation blob; the wrapper inventory combines both branches.
Read the machine-owned preference path through the shared-state worker once per turn and carry the result through delivery and prompt assembly. Preserve scoped path precedence, fresh preference-file reads, and synchronous SDK compatibility.

Move existing machine-state, ACP prompt, and CLI error helpers to their owning modules to keep capped orchestration files from growing. No schema, retention, durability, or configuration changes.
@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 scripts Repository scripts agents Agent runtime and tooling size: XL 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
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 4:41 AM ET / 08:41 UTC (Revision 8).

ClawSweeper review

What this changes

The PR reads text-to-speech preferences through the existing database worker and carries the prepared path through reply delivery and agent prompts while preserving released plugin calls.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still performs the synchronous TTS preference reads this PR removes. No actionable introduced defect was found, and the prior migration checklist is inapplicable because the compatibility record is static metadata and no stored-data contract changes.

Priority: P2
Reviewed head: 4ebfcd375fe80a341f644655fbfbac6fd6ad6d1d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound worker-based optimization with strong scoped runtime evidence, preserved SDK compatibility, and no actionable finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded before/after Gateway and WebSocket workloads exercise the TTS preparation and dispatch path with real storage, showing zero TTS caller SQL after the change and successful completion. Final-head boundary tests and CI supplement that historical measurement. The compatibility registry is static metadata and the existing stored preference format is unchanged, so no data-model migration applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded before/after Gateway and WebSocket workloads exercise the TTS preparation and dispatch path with real storage, showing zero TTS caller SQL after the change and successful completion. Final-head boundary tests and CI supplement that historical measurement. The compatibility registry is static metadata and the existing stored preference format is unchanged, so no data-model migration applies.
Evidence reviewed 9 items Pinned introduced patch: Reviewed the merge-base-to-head hunks, including worker command routing, preference preparation, dispatch propagation, prompt assembly, SDK compatibility, and test changes. The stale GitHub test merge was not used to infer removal of current-main behavior.
Current main still needs this optimization: Fetched main's shouldAttemptTtsPayload still calls readConfigMachineState for tts.prefsPath synchronously; it does not consume prepared worker facts. The related merged schema-facts prerequisite addresses database admission rather than this TTS caller cutover.
Existing storage owner and unchanged format: Preparation issues the fixed tts.prefsPath read through the existing shared-state reader. The domain kernel reads the existing config_machine_state row without changing its key, JSON representation, schema, or writer. The operator-policy version guard is preserved during extraction.
Findings None None.
Security None None.

How this fits together

Text-to-speech settings determine whether replies become speech and what voice guidance enters agent prompts. Reply dispatch combines machine preferences with configuration and fresh preference-file contents before prompt construction and audio delivery.

flowchart TD
  A[Machine preference row] --> B[Shared database read worker]
  B --> C[Prepared preference path]
  D[Configuration and environment] --> E[TTS settings resolution]
  C --> E
  F[Fresh preference file] --> E
  E --> G[Agent prompt guidance]
  E --> H[Reply speech delivery]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +197, Tests +139, Docs +26, Other +1. Total +363 across 52 files.

View PR surface stats
Area Files Added Removed Net
Source 40 250 53 +197
Tests 9 149 10 +139
Docs 2 26 0 +26
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 52 426 63 +363

Review metrics

Metric Value Why it matters
Scoped SQL reduction TTS main-thread statements: 10 → 0 per warmed turn The recorded workload supports this path-specific reduction; it does not establish aggregate SQL or latency improvement.
Production versus test growth production +250/-53; tests and test support +149/-10 Production growth implements worker preparation and complete caller propagation, with an explicit released-SDK compatibility record.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugins/compat/tts-preferences-record.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing worker to prepare one turn-scoped machine path while retaining configuration precedence, fresh file reads, and the released synchronous SDK contract.

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

Yes, source inspection identifies the current-main synchronous preference read, and the recorded Gateway workload measures its SQL cost; this reviewer did not execute the workload.

Is this the best way to solve the issue?

Yes, the patch reuses the existing read worker and carries explicit presence or absence through consumers without adding a competing cache or changing released call requirements.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 403b0ced4f6b.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime performance improvement with preserved user settings and plugin compatibility.
  • 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 (live_output): Recorded before/after Gateway and WebSocket workloads exercise the TTS preparation and dispatch path with real storage, showing zero TTS caller SQL after the change and successful completion. Final-head boundary tests and CI supplement that historical measurement. The compatibility registry is static metadata and the existing stored preference format is unchanged, so no data-model migration applies.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded before/after Gateway and WebSocket workloads exercise the TTS preparation and dispatch path with real storage, showing zero TTS caller SQL after the change and successful completion. Final-head boundary tests and CI supplement that historical measurement. The compatibility registry is static metadata and the existing stored preference format is unchanged, so no data-model migration applies.

Evidence

What I checked:

  • Pinned introduced patch: Reviewed the merge-base-to-head hunks, including worker command routing, preference preparation, dispatch propagation, prompt assembly, SDK compatibility, and test changes. The stale GitHub test merge was not used to infer removal of current-main behavior. (4ebfcd375fe8)
  • Current main still needs this optimization: Fetched main's shouldAttemptTtsPayload still calls readConfigMachineState for tts.prefsPath synchronously; it does not consume prepared worker facts. The related merged schema-facts prerequisite addresses database admission rather than this TTS caller cutover. (src/tts/tts-config.ts:162, 403b0ced4f6b)
  • Existing storage owner and unchanged format: Preparation issues the fixed tts.prefsPath read through the existing shared-state reader. The domain kernel reads the existing config_machine_state row without changing its key, JSON representation, schema, or writer. The operator-policy version guard is preserved during extraction. (src/state/config-machine-state.ts:31, 4ebfcd375fe8)
  • Prior migration concern resolved by source: The new compatibility record is a typed constant consumed by the metadata registry. It records retained synchronous SDK behavior and a next-major removal gate; it does not install a schema, persist state, rewrite preferences, or introduce a migration. The previous review's generic migration next step therefore creates no remaining blocker. (src/plugins/compat/tts-preferences-record.ts:3, 4ebfcd375fe8)
  • Released SDK compatibility: The v2026.9.8 resolver accepts one config argument and returns a string synchronously. The proposed resolver retains that call and return shape, with prepared facts optional; the compile-time contract also covers prompt hints and asynchronous payload application. (src/tts/tts-settings.ts:188, 4ebfcd375fe8)
  • Meaningful worker-boundary regression coverage: The two new cases use the real native reader to check zero caller SQL, preserved environment precedence, refreshed next-turn machine facts, fresh file contents within a captured path, and prepared absence without store creation or synchronous fallback. The earlier mock-isolation finding is addressed by the explicit isolation comment in the dispatch fixture. (src/tts/tts-preferences.worker.test.ts:25, 4ebfcd375fe8)

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 (7 earlier review cycles)
  • reviewed 2026-10-04T01:56:21.536Z sha bd25d97 :: blocked before merge. :: none
  • reviewed 2026-10-04T02:11:04.617Z sha bd25d97 :: blocked before merge. :: none
  • reviewed 2026-10-04T05:14:08.349Z sha c5919d0 :: blocked before merge. :: none
  • reviewed 2026-10-04T05:55:20.211Z sha c5919d0 :: blocked before merge. :: [P3] Qualify the isolated TTS preference mock
  • reviewed 2026-10-04T06:04:20.802Z sha b70ed5e :: blocked before merge. :: none
  • reviewed 2026-10-04T06:47:18.472Z sha b70ed5e :: blocked before merge. :: none
  • reviewed 2026-10-04T08:19:49.061Z sha 4ebfcd3 :: blocked before merge. :: none

Record and type-check the retained synchronous Plugin SDK calls while host turns carry worker-prepared preferences. Include the compatibility metadata in the PR wrapper dependency inventory.

Update TTS and cron fixtures to supply and expect prepared preference facts. Bind pending-final recovery fixtures to the queue shared-state environment, matching the worker admission ownership boundary without changing assertions.

Validation: 192 focused tests, wrapper inventory, released SDK type graph, lint, documentation links, and clean P2 review.
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit f71ea0f into main Oct 4, 2026
167 of 168 checks passed
@steipete
steipete deleted the dbasync/ttsprepare branch October 4, 2026 09:18
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…164694)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(tts): carry prepared TTS preferences through dispatch

Read the machine-owned preference path through the shared-state worker once per turn and carry the result through delivery and prompt assembly. Preserve scoped path precedence, fresh preference-file reads, and synchronous SDK compatibility.

Move existing machine-state, ACP prompt, and CLI error helpers to their owning modules to keep capped orchestration files from growing. No schema, retention, durability, or configuration changes.

* fix(tts): finish prepared preference compatibility

Record and type-check the retained synchronous Plugin SDK calls while host turns carry worker-prepared preferences. Include the compatibility metadata in the PR wrapper dependency inventory.

Update TTS and cron fixtures to supply and expect prepared preference facts. Bind pending-final recovery fixtures to the queue shared-state environment, matching the worker admission ownership boundary without changing assertions.

Validation: 192 focused tests, wrapper inventory, released SDK type graph, lint, documentation links, and clean P2 review.

* test(tts): document dispatch preference mock isolation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation 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: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant