Repository navigation
fix(talk): settle accepted voice work before shutdown - #166795
Conversation
Keep failed entry attempts from releasing a live consult owner, and drain accepted digest retries when later admission fails. Construct the digest owner at its runtime boundary.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:03 PM ET / 18:03 UTC (Revision 7). ClawSweeper reviewWhat this changesThe PR retains accepted Talk transcripts, tool outcomes, and mutation summaries until shutdown settlement, while preventing confirmed summaries from being resent during bookkeeping retries. Example: A voice summary is sent to channel:custom-recipient and its delivery-marker write fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review The earlier custom-store finding and heading request are resolved, with no remaining actionable finding. This PR remains useful: current main still lacks the settlement and delivery-receipt repair. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherTalk connects voice providers and clients to ordinary agent conversations. Its persistence owners save finalized speech and tool outcomes, then deliver a short mutation summary to the conversation’s last messaging destination. flowchart TD
A[Voice clients and providers] --> B[Accepted voice work]
C[Gateway shutdown] --> D[Close providers and refuse new work]
D --> B
B --> E[Join transcripts and tool outcomes]
E --> F[Deliver mutation summary]
F --> G[Retain confirmed send receipt]
G --> H[Finish bookkeeping before releasing persistence]
Technical reviewBest possible solution: Keep accepted voice work under the existing Gateway and database lifetimes, with recipient lookup and confirmed-delivery bookkeeping bound to their original stores. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the reproduction path: send a mutation summary, fail its marker write, and trigger another lifecycle retry; shutdown coverage also injects provider failure while accepted writes remain pending. This review did not execute those scenarios. Is this the best way to solve the issue? Yes, the repair preserves detached logical-call close while joining accepted work at Gateway teardown, and reuses the existing session reader and bounded digest owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 41dd80a3b884. Provenance checked
TestingProof path: in-process harness. Added test files: 13. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +923, Tests +1800, Docs +2, Other 0. Total +2725 across 34 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (6 earlier review cycles)
|
Keep conversation-store identities separate from voice metadata, retain confirmed sends through delivery-marker retries, and record missing-conversation failures. Preserve live Gateway cleanup across same-file database reopens and drain relay producers before retiring persistence. Integrate main with its formatter and parser cleanup intact.
|
@clawsweeper re-review The custom |
|
🦞👀 Re-review progress:
|
Avoid a shadowed local in lifetime retirement and use the relay fixture defaults without changing shutdown coverage.
|
@clawsweeper re-review Final head: 6d62721. The follow-up only renames a shadowed local and removes relay fixture arguments identical to its defaults; fresh P2 review is clean. The prior review confirmed the custom-store finding resolved with no actionable runtime findings. The requested PR heading is now corrected. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…167463) ## What Problem This Solves Fixes: a model pulled with `ollama pull` after OpenClaw's Ollama setup never shows up in the model pickers, even after **Refresh**, until the user edits config. ## User Impact User impact: after setting up a local or self-hosted Ollama server, newly pulled chat models appear in the Control UI picker and `openclaw models list --provider ollama` on the next model-list refresh, with no config edit or Gateway restart. Setup-saved models keep their settings. Embedding-only models stay out. Behavior change to note: a nonempty `models.providers.ollama.models` list on a self-hosted endpoint no longer acts as a picker allowlist. Users who want only their listed models use `models.mode: "replace"`, `plugins.entries.ollama.config.discovery.enabled: false`, or the existing model allowlist. Hosted `https://ollama.com` still uses only the configured rows. ## Why This Change Was Made Setup saves every model it finds into `models.providers.ollama.models`, and Ollama discovery returned only those saved rows whenever that list was nonempty, without listing `/api/tags`. That pinned the inventory to setup time. Discovery now lists `/api/tags` for self-hosted endpoints even when models are configured; listed models the config already has are dropped from the discovered set, so configured rows keep all their settings (for example the documented `compat.supportsTools: false` workaround, even when `/api/show` advertises `tools`), and the existing config merge adds the other installed chat models. Discovery opt-out, hosted Ollama Cloud, endpoint/credential rules and failure handling are unchanged: if `/api/tags` fails, the configured rows stay. The stale WIP also added a 30 s fallback expiry in core inventory capture. It is not part of this PR: since #167008, ordinary `models.list` reads no longer renew expired provider inventory, so a deadline would not make a plain picker open re-list. Explicit **Refresh** (Models page, `models list --refresh`), startup and config/credential changes own discovery, and that path now picks up new pulls. ## Evidence Real run on a disposable `ollama/ollama` Docker container (no host mounts, removed afterwards) with isolated profiles, running real `openclaw onboard --non-interactive --auth-choice ollama --custom-base-url http://127.0.0.1:11471 --custom-model-id qwen2.5:0.5b`. Setup saved `models.providers.ollama.models = ["qwen2.5:0.5b"]` (`mode: "merge"`). The config file hash was identical before and after every step below, and the Gateway was not restarted between pull and listing. | Step | `origin/main` (6070074) | This branch | | --- | --- | --- | | `models list --provider ollama` after setup | `qwen2.5:0.5b` | `qwen2.5:0.5b` | | `ollama pull qwen3:0.6b`, then `models list --provider ollama --refresh` | `qwen2.5:0.5b` only (also 45 s later) | `qwen2.5:0.5b`, `qwen3:0.6b` | | Control UI chat picker | Ollama (1) | — | | `ollama pull smollm2:135m` + `all-minilm` (embedding), Settings → Models → **Refresh**, reopen chat picker | — | Ollama (3): `qwen2.5:0.5b`, `qwen3:0.6b`, `smollm2:135m`; `all-minilm` absent | | `infer model run --gateway --model ollama/qwen3:0.6b --prompt "Reply with exactly: PULLED_OK"` | — | `ok: true`, provider `ollama`, model `qwen3:0.6b`, output `PULLED_OK` (7 s) | The host was heavily loaded (load average ~70 on 32 cores). Ollama's default 32 llama.cpp threads stalled while loading the model, so before the chat turn the pulled model's Ollama-side default was set to `num_thread 6` (`ollama create qwen3:0.6b` with `FROM qwen3:0.6b`). OpenClaw config was not touched. An earlier full-agent Control UI turn to the same model was stopped after its 8.8k-token prompt ran at about 8 tokens/s under that load. Without **Refresh**, a plain `models list` / picker open keeps showing the published catalog on both builds; that is the existing #167008 read policy, not changed here. Tests: - New `src/agents/models-config.ollama-secretref.test.ts` case runs the registered Ollama plugin through the real models-config planner. Configured `qwen2.5:0.5b` (`compat.supportsTools: false`) plus `/api/tags` listing `qwen3:0.6b` and `nomic-embed-text`, with `/api/show` advertising `tools`, results in `[qwen2.5:0.5b (supportsTools: false), qwen3:0.6b (supportsTools: true)]`. A later `/api/tags` 503 keeps `[qwen2.5:0.5b (supportsTools: false)]`. Before 392ff91 the compat assertion failed with the setup row's compat replaced by the discovered `{ supportsTools: true, supportsUsageInStreaming: true, supportsJsonSchemaResponseFormat: true }`. Against main's `discovery-shared.ts` it fails with `expected [ 'qwen2.5:0.5b' ] to deeply equal [ 'qwen2.5:0.5b', 'qwen3:0.6b' ]`. - Existing tests that asserted "no discovery with configured models" now assert the discovery request's credentials instead. Local synthetic auth sends no `Authorization`; ambient `OLLAMA_API_KEY` stays away from local hosts; a configured remote key or SecretRef is sent. - `extensions/ollama/src/discovery-shared.test.ts`, `extensions/ollama/provider-discovery.test.ts`, `extensions/ollama/index.test.ts`: 135 passed. `models-config.ollama-secretref.test.ts`: 7 passed. After 392ff91: `node scripts/run-vitest.mjs run` on `models-config.ollama-secretref`, `provider-discovery`, `discovery-shared`, `models-config.merge`, `model-compat-catalog` tests: 3 shards passed. `oxlint --type-aware` on changed files: clean. - `node scripts/check-changed.mjs`: every step passed except the dead export scan, which flags `src/talk/client-voice-session-store.ts: ClientVoiceToolEffect`. This PR does not touch that file; the export comes from main (#166795). Rerun at 392ff91: same single unrelated failure; every other step (including core/extension typechecks) passed. ### Configured model settings survive discovery (392ff91) Real run, isolated profile, disposable `ollama/ollama` container on `127.0.0.1:21434` (removed afterwards), Gateway on loopback. Config: `models.providers.ollama.models = [{ id: "qwen2.5:0.5b", compat: { supportsTools: false } }]`; `/api/show` for `qwen2.5:0.5b` returns `capabilities: ["completion", "tools"]`. | Step | Effective rows (`gateway call models.list`, provider `ollama`) | | --- | --- | | After Gateway start | `qwen2.5:0.5b` `supportsTools: false` | | `ollama pull qwen3:0.6b`, then `models list --provider ollama --refresh` | `qwen2.5:0.5b` `supportsTools: false`; `qwen3:0.6b` `supportsTools: true` (ctx 40960) | | `openclaw agent --agent main -m "Reply with exactly the word: pong"` on `ollama/qwen2.5:0.5b` | `status: ok`, reply `pong`; run report tools `entries: []`, `schemaChars: 0` (no tool schemas sent) | The container ran with `OLLAMA_CONTEXT_LENGTH=16384`; at Ollama's default 4096 the 6k-token system prompt overflowed (an Ollama server setting, unrelated to this change). ### Startup with an unreachable or slow configured endpoint #28827 skipped discovery for configured models to avoid startup delays. Measured Gateway start (spawn of `pnpm openclaw --profile … gateway run` to `/readyz` 200) with the same configured model, `origin/main` (6070074) vs this branch (392ff91), alternating, 3 runs each. Endpoints: unreachable = closed loopback port; hang = loopback server that accepts and never answers; slow = every response after 2 s. Host load average was 28–46 on 32 cores, so absolute numbers are noisy. | Endpoint | main `/readyz` ms (r1, r2, r3) | branch `/readyz` ms (r1, r2, r3) | | --- | --- | --- | | unreachable | 8988, 18618, 58035 | 9401, 21341, 32035 | | hang | 9507, 32831, 25592 | 8351, 9313, 27288 | | slow (2 s) | 18887, 10279, 11986 | 9144, 20723, 15589 | No systematic difference. On the branch, every `/api/tags` request reached the hang and slow servers 2.0–3.5 s **after** the Gateway logged `ready` (none before it), so discovery is not on the startup path. `models list --provider ollama --json` right after ready returned the configured row in 2.8–10.6 s on both builds (main 2.8–7.9 s, branch 2.9–10.6 s); in hang runs 1 and 3 it returned before the hanging `/api/tags` request hit its 5 s timeout. Main also sends one post-ready `/api/show` for the configured model. No overlap with Pash/Sarah changes Merge danger: two-way door (one conditional in the Ollama plugin plus docs; no schema, stored-data, config-option or protocol change). Blast radius: users with a self-hosted Ollama endpoint and a nonempty configured model list. Their picker gains the other installed chat models, and startup and refresh now send `/api/tags` and `/api/show` requests to that server. If the server is offline, Ollama now reports an unavailable refresh, keeps the configured rows, and retries with backoff. Hosted Ollama Cloud, discovery opt-out and replace mode are unaffected. ### Screenshots Before (`origin/main`), chat picker after `ollama pull qwen3:0.6b` and `--refresh`: Ollama (1).  After (this branch), chat picker after Settings → Models → **Refresh**: Ollama (3), embedding model absent.  Co-authored-by: Ayaan Zaidi <[email protected]>
* fix(talk): preserve voice settlement across close failures * test(talk): preserve runtime exports in voice fixtures * fix(talk): settle accepted voice work before shutdown * fix(talk): retain voice settlement until explicit release Keep failed entry attempts from releasing a live consult owner, and drain accepted digest retries when later admission fails. Construct the digest owner at its runtime boundary. * test(talk): assert voice binding during accepted work * chore(talk): include upstream internal export cleanup * test(talk): separate digest source recovery coverage * test(talk): keep lifecycle proof within existing gates Avoid a shadowed local in lifetime retirement and use the relay fixture defaults without changing shutdown coverage.
…penclaw#167463) ## What Problem This Solves Fixes: a model pulled with `ollama pull` after OpenClaw's Ollama setup never shows up in the model pickers, even after **Refresh**, until the user edits config. ## User Impact User impact: after setting up a local or self-hosted Ollama server, newly pulled chat models appear in the Control UI picker and `openclaw models list --provider ollama` on the next model-list refresh, with no config edit or Gateway restart. Setup-saved models keep their settings. Embedding-only models stay out. Behavior change to note: a nonempty `models.providers.ollama.models` list on a self-hosted endpoint no longer acts as a picker allowlist. Users who want only their listed models use `models.mode: "replace"`, `plugins.entries.ollama.config.discovery.enabled: false`, or the existing model allowlist. Hosted `https://ollama.com` still uses only the configured rows. ## Why This Change Was Made Setup saves every model it finds into `models.providers.ollama.models`, and Ollama discovery returned only those saved rows whenever that list was nonempty, without listing `/api/tags`. That pinned the inventory to setup time. Discovery now lists `/api/tags` for self-hosted endpoints even when models are configured; listed models the config already has are dropped from the discovered set, so configured rows keep all their settings (for example the documented `compat.supportsTools: false` workaround, even when `/api/show` advertises `tools`), and the existing config merge adds the other installed chat models. Discovery opt-out, hosted Ollama Cloud, endpoint/credential rules and failure handling are unchanged: if `/api/tags` fails, the configured rows stay. The stale WIP also added a 30 s fallback expiry in core inventory capture. It is not part of this PR: since openclaw#167008, ordinary `models.list` reads no longer renew expired provider inventory, so a deadline would not make a plain picker open re-list. Explicit **Refresh** (Models page, `models list --refresh`), startup and config/credential changes own discovery, and that path now picks up new pulls. ## Evidence Real run on a disposable `ollama/ollama` Docker container (no host mounts, removed afterwards) with isolated profiles, running real `openclaw onboard --non-interactive --auth-choice ollama --custom-base-url http://127.0.0.1:11471 --custom-model-id qwen2.5:0.5b`. Setup saved `models.providers.ollama.models = ["qwen2.5:0.5b"]` (`mode: "merge"`). The config file hash was identical before and after every step below, and the Gateway was not restarted between pull and listing. | Step | `origin/main` (618f4d2) | This branch | | --- | --- | --- | | `models list --provider ollama` after setup | `qwen2.5:0.5b` | `qwen2.5:0.5b` | | `ollama pull qwen3:0.6b`, then `models list --provider ollama --refresh` | `qwen2.5:0.5b` only (also 45 s later) | `qwen2.5:0.5b`, `qwen3:0.6b` | | Control UI chat picker | Ollama (1) | — | | `ollama pull smollm2:135m` + `all-minilm` (embedding), Settings → Models → **Refresh**, reopen chat picker | — | Ollama (3): `qwen2.5:0.5b`, `qwen3:0.6b`, `smollm2:135m`; `all-minilm` absent | | `infer model run --gateway --model ollama/qwen3:0.6b --prompt "Reply with exactly: PULLED_OK"` | — | `ok: true`, provider `ollama`, model `qwen3:0.6b`, output `PULLED_OK` (7 s) | The host was heavily loaded (load average ~70 on 32 cores). Ollama's default 32 llama.cpp threads stalled while loading the model, so before the chat turn the pulled model's Ollama-side default was set to `num_thread 6` (`ollama create qwen3:0.6b` with `FROM qwen3:0.6b`). OpenClaw config was not touched. An earlier full-agent Control UI turn to the same model was stopped after its 8.8k-token prompt ran at about 8 tokens/s under that load. Without **Refresh**, a plain `models list` / picker open keeps showing the published catalog on both builds; that is the existing openclaw#167008 read policy, not changed here. Tests: - New `src/agents/models-config.ollama-secretref.test.ts` case runs the registered Ollama plugin through the real models-config planner. Configured `qwen2.5:0.5b` (`compat.supportsTools: false`) plus `/api/tags` listing `qwen3:0.6b` and `nomic-embed-text`, with `/api/show` advertising `tools`, results in `[qwen2.5:0.5b (supportsTools: false), qwen3:0.6b (supportsTools: true)]`. A later `/api/tags` 503 keeps `[qwen2.5:0.5b (supportsTools: false)]`. Before 392ff91 the compat assertion failed with the setup row's compat replaced by the discovered `{ supportsTools: true, supportsUsageInStreaming: true, supportsJsonSchemaResponseFormat: true }`. Against main's `discovery-shared.ts` it fails with `expected [ 'qwen2.5:0.5b' ] to deeply equal [ 'qwen2.5:0.5b', 'qwen3:0.6b' ]`. - Existing tests that asserted "no discovery with configured models" now assert the discovery request's credentials instead. Local synthetic auth sends no `Authorization`; ambient `OLLAMA_API_KEY` stays away from local hosts; a configured remote key or SecretRef is sent. - `extensions/ollama/src/discovery-shared.test.ts`, `extensions/ollama/provider-discovery.test.ts`, `extensions/ollama/index.test.ts`: 135 passed. `models-config.ollama-secretref.test.ts`: 7 passed. After 392ff91: `node scripts/run-vitest.mjs run` on `models-config.ollama-secretref`, `provider-discovery`, `discovery-shared`, `models-config.merge`, `model-compat-catalog` tests: 3 shards passed. `oxlint --type-aware` on changed files: clean. - `node scripts/check-changed.mjs`: every step passed except the dead export scan, which flags `src/talk/client-voice-session-store.ts: ClientVoiceToolEffect`. This PR does not touch that file; the export comes from main (openclaw#166795). Rerun at 392ff91: same single unrelated failure; every other step (including core/extension typechecks) passed. ### Configured model settings survive discovery (392ff91) Real run, isolated profile, disposable `ollama/ollama` container on `127.0.0.1:21434` (removed afterwards), Gateway on loopback. Config: `models.providers.ollama.models = [{ id: "qwen2.5:0.5b", compat: { supportsTools: false } }]`; `/api/show` for `qwen2.5:0.5b` returns `capabilities: ["completion", "tools"]`. | Step | Effective rows (`gateway call models.list`, provider `ollama`) | | --- | --- | | After Gateway start | `qwen2.5:0.5b` `supportsTools: false` | | `ollama pull qwen3:0.6b`, then `models list --provider ollama --refresh` | `qwen2.5:0.5b` `supportsTools: false`; `qwen3:0.6b` `supportsTools: true` (ctx 40960) | | `openclaw agent --agent main -m "Reply with exactly the word: pong"` on `ollama/qwen2.5:0.5b` | `status: ok`, reply `pong`; run report tools `entries: []`, `schemaChars: 0` (no tool schemas sent) | The container ran with `OLLAMA_CONTEXT_LENGTH=16384`; at Ollama's default 4096 the 6k-token system prompt overflowed (an Ollama server setting, unrelated to this change). ### Startup with an unreachable or slow configured endpoint openclaw#28827 skipped discovery for configured models to avoid startup delays. Measured Gateway start (spawn of `pnpm openclaw --profile … gateway run` to `/readyz` 200) with the same configured model, `origin/main` (618f4d2) vs this branch (392ff91), alternating, 3 runs each. Endpoints: unreachable = closed loopback port; hang = loopback server that accepts and never answers; slow = every response after 2 s. Host load average was 28–46 on 32 cores, so absolute numbers are noisy. | Endpoint | main `/readyz` ms (r1, r2, r3) | branch `/readyz` ms (r1, r2, r3) | | --- | --- | --- | | unreachable | 8988, 18618, 58035 | 9401, 21341, 32035 | | hang | 9507, 32831, 25592 | 8351, 9313, 27288 | | slow (2 s) | 18887, 10279, 11986 | 9144, 20723, 15589 | No systematic difference. On the branch, every `/api/tags` request reached the hang and slow servers 2.0–3.5 s **after** the Gateway logged `ready` (none before it), so discovery is not on the startup path. `models list --provider ollama --json` right after ready returned the configured row in 2.8–10.6 s on both builds (main 2.8–7.9 s, branch 2.9–10.6 s); in hang runs 1 and 3 it returned before the hanging `/api/tags` request hit its 5 s timeout. Main also sends one post-ready `/api/show` for the configured model. No overlap with Pash/Sarah changes Merge danger: two-way door (one conditional in the Ollama plugin plus docs; no schema, stored-data, config-option or protocol change). Blast radius: users with a self-hosted Ollama endpoint and a nonempty configured model list. Their picker gains the other installed chat models, and startup and refresh now send `/api/tags` and `/api/show` requests to that server. If the server is offline, Ollama now reports an unavailable refresh, keeps the configured rows, and retries with backoff. Hosted Ollama Cloud, discovery opt-out and replace mode are unaffected. ### Screenshots Before (`origin/main`), chat picker after `ollama pull qwen3:0.6b` and `--refresh`: Ollama (1).  After (this branch), chat picker after Settings → Models → **Refresh**: Ollama (3), embedding model absent.  Co-authored-by: Ayaan Zaidi <[email protected]>
Fix the fixture race introduced by c44f6c7 (openclaw#166795). A partial send retires its reader worker before the digest attempt settles; fake timers cannot join that work. Reuse the existing settlement barrier for partial delivery and the sibling post-close effects test.
What Problem This Solves
Gateway shutdown could release persistence resources before accepted voice transcripts and mutation summaries settled. Provider-cleanup errors could skip the join, and detached digest work could lose its accepted shutdown context. A confirmed send followed by a failed delivery-marker write could also be sent again.
Solution
Give accepted voice work a settlement lifetime captured before queue/provider waits. Close refuses new work, closes providers, and joins the accepted transcript and digest work before persistence teardown, including cleanup-error paths. Detached delivery restores that captured context, and delayed work retains its original physical store.
Keep a confirmed-send receipt across marker retries and retry only the marker. Partial or unknown delivery outcomes stay fenced in the existing bounded digest owner. Accepted consults retain their permit until the existing Gateway root actually releases, including when diagnostics are disabled. A failed child operation does not release its parent lifetime; the explicit owner releases it. If a later retry admission fails, the already accepted prefix still starts and settles. A retained failed digest is eligible for agent-wide retry only within its original shared-state admission generation, so close/reopen cannot make it block unrelated stale-call recovery. Its delivery fence and five-minute retention remain intact.
Impact
Voice close now completes accepted persistence and records outbound mutation-summary delivery even when provider cleanup fails. Stored formats, transcript/event barriers, FIFO, native incognito ownership, and known-unsent retry behavior are preserved. No schema, service, persistent cache, configuration option, durability policy, or new
OPENCLAW_*name is added.Production is 17 files, +1,527 / −700 / net +827 (2,227 changed lines); 35 total files including tests and tooling. The script-only internal-export cleanup is counted separately as tooling (+1/−1); earlier totals included those two tooling lines. The retry-generation repair adds four production lines and removes one. Two final internal-export cleanups match main’s existing fix: one type declaration and one script helper were used only within their own files. They resolve inherited unused-export failures without changing runtime behavior or scanner policy. The growth beyond the immediate close/digest fixes covers native and relay queue custody, original-store descriptors, Gateway root-release notification, and bounded digest intents/receipts. These pieces must accompany the lifecycle repair: deferring them would leave native/relay accepted work outside the close join, let delayed work select a different store, or allow a confirmed send to replay during marker recovery. The prerequisite therefore establishes a complete settlement contract while persistence still uses its existing owners. The stacked agent-executor PR changes write placement, transaction predicates, and atomic transcript bookkeeping against that contract.
Coordination overlaps: #165921, #166293, #166259, #166252, #166444, #166445, main test consolidation #166762, and umbrella #162433, plus parallel session-entry, turn-budget, restart, and cleanup work. Whoever lands second integrates main. Neither PR is being landed by this work.
Evidence
Final head:
3269ce85fba479f4583287b6d41e3535da389c1d; tree:6ef6d81fa3e82e361d6cd4017072d0015840a41e; integrated main base:950bd83e85c227b6872e8bda585cffe82418b55f.The earlier integration at
70ad00cd4be81b0d8e878444b49d57636c325d8bpreserved main’s recovery-test consolidation: source-safety cases live in the canonical digest lifecycle suite, and the removed recovery test file stays removed. At that head, fifteen of the sixteen production files retained their previously measured bytes; the remaining Gateway lifecycle file incorporates main’s diagnostics/metrics extraction while preserving Talk drain ordering. The subsequent integration through950bd83ebrings in main’s existing generated Workboard manifest repair, required because the canonical QA build otherwise dirtied the baseline. It preserves the voice owners apart from the explicit retry-generation repair above; no build profile or source-cleanliness check was weakened.Final full voice-diff Codex P2 review: scoped-clean, 293.66s, with unchanged source verification. The review found and the final patch fixed the retired digest-admission recovery defect; its regression failed at the original live-admission assertion in 134.92s and passed with its siblings in 135.75s. The final test-only split passed P2 review in 92.86s. Physical-source cases now have a sibling suite and shared test harness; all 27 lifecycle/source scenarios remain covered. Moving the former warm-up test exposed a cold-import ordering defect in the partial-delivery fixture, fixed by awaiting the sender before advancing fake time. Earlier full and export-delta reviews also passed on their recorded heads. Regressions failed on the old cleanup-error join, detached accepted-digest context, premature root release, and duplicate-send behavior. The final sideband regression checks the binding during execution and its retirement after completion.
pnpm check:changed --base 950bd83e --head HEAD --timedpnpm test src/gateway/talk/handlers/client.test.ts --maxWorkers=1)pnpm check:changed --base 40d735e4 --head HEAD --timednode scripts/check-changed.mjsc335805fAll focused commands used
--maxWorkers=1. Times are measured command wall times, not estimated CI seconds. Prior remote proof ran in this Testbox job; its later canonical build was interrupted when the statement result was escalated. That interrupted build is not a passing gate. Previous-head proof completed in this Testbox job, with exact tree verification before and after the check.Statement evidence
Five complete alternating main/candidate pairs ran on one Testbox with Node v26.10.0 and SQLite 3.53.4. Baseline:
4ed39a25f674ceecbe7bb066503941085c911b6e. Measured candidate:e0d214a0acf904ad6b66bfd16257add37296f512(tree33c5e9d5288b0aa4f7ef5b98f6d046dac7262f43). Thec335805fa1d10e7cc060b22bde604c3b55f5f46efollow-up changes tests only and retains this measured production code. The later main integration is described above; these measurements remain attributed to the recorded base and candidate, not represented as a new run on the integrated head. The final retry-generation change compares retained admission objects and adds no SQL, request, timer, or ordinary-turn work.Every cell completed its workload, passed exact phase/thread/SQL conservation, and left no fixture child process. All gated-window duration ratios are below 1.5. Counts and durations below are side medians; raw all-thread cohort totals are included separately. No samples or background statements were removed.
Warmed counts are per turn; the warmed duration is the complete ten-turn window and its cohort total covers 50 turns per side. Complete-workload medians are computed from whole runs, not by adding independent phase medians.
Coordinator approval: the retained first-turn increase of 32 statements (+0.5483%) is explicitly approved as unchanged-owner timing/background variation after trace attribution. The raw increase remains visible. Warmed turns decrease by seven statements per turn. At that measured base, T1 was 835 → 835. The final integrated-base ratchet is 797 → 797, likewise neutral.
All 110 modules on positively changed SQL stacks have identical Git blobs between the measured base and candidate; none is a PR1-touched path. First-turn traces contain no Talk frames. Voice-named index admission/schema checks remain exactly 14 in every baseline and candidate cell. The new startup close preparation captures the existing admitted context and retains an in-memory lifetime; root-release observers register lazily for voice consults and introduce no model-catalog request.
Compaction and shutdown qualify together as adjacent timing-dependent maintenance windows. Their combined side medians are 1,944 → 1,937 (−7). These totals are calculated per run before taking medians.
The combined duration medians are 2.032 → 1.988 seconds (ratio 0.978). Individual positive pair deltas remain visible; qualification uses the coordinator’s current median rule. Native receipts retain process/thread/site identities, SQL, trace lines, and phase timestamp bounds. The observer does not provide a per-statement clock or request census.
The initial focused voice fixture lacked a runtime predicate export. After repairing only that synthetic transport fixture, three baseline/candidate voice pairs completed functionally, but the numeric archive could not be retrieved after lease retirement. No numeric voice comparison is claimed from that attempt. The ordinary-workload archive above was downloaded and hash-verified. SDK and published-driver update proof belong to the stacked cutover PR.
Landing correction and CI attribution
The custom
session.storefinding is fixed. Digest acceptance captures the configured conversation-store files independently of voice metadata before queued delivery. Recipient lookup uses the existing session worker and pins its selected physical file across known-unsent retries. Missing conversation rows record a failed attempt instead of silently completing. Confirmed sends retain their receipt and retry only the marker in the original voice metadata database.Database reopening also preserves live Gateway cleanup ownership. A store initially admitted before file creation can retain a path coordination key while a later admission uses its file identity; both resolve to the same retained owner only when physical identity and birthtime match. Retired operation admissions remain invalid. Relay reset proof now follows the production Talk-drain-before-database-retirement sequence and verifies the final transcript.
CI on takeover head
3269ce85fba479f4583287b6d41e3535da389c1d(run 37755777001) passed production and all test type checks, superseding the older type reds. Its two Node failures were PR-caused: OpenResponses teardown lost retained voice ownership after store reopen, and relay reset retired admission before final producer writes. Both original failing cases pass locally after repair; no inherited-failure exception is claimed for them.The final digest/source/registry command passed 36 tests across three files (
pnpm test src/talk/client-voice-session.digest-source.test.ts src/talk/client-voice-session.digest-retry.test.ts src/gateway/talk/session-registry.test.ts --maxWorkers=1, 258.36s wall time). Custom-store cases cover both an absent default row and an obsolete default recipient, preserve one confirmed send through marker failure, and verify metadata stays in its own database. Missing-conversation diagnostics and the compact reopen regression also pass. Original OpenResponses continuity and both relay final-write cases pass. Per-file CI seconds are unavailable from the retained artifacts; local timings above are measured launcher wall time.Fresh full-candidate and follow-up Codex P2 reviews are scoped-clean. Post-integration production types, all 27 core test type graphs (resuming after correcting the synthetic delivery fixture), and Madge pass. Released-SDK reachability was checked against
v2026.10.1-beta.1andv2026.9.9: the changed Talk functions are not exported throughsrc/plugin-sdk,api.runtime, or documented SDK subpaths. No newOPENCLAW_*name, schema, persisted format, retention policy, or update migration is introduced.The existing five alternating SQL pairs and their coordinator-approved first-turn attribution are retained under Landing Acceleration v2. The conflict resolution only preserved main’s formatter/parser inlining; no new SQL measurement was required. The queued/detached voice paths retain their original metadata owner and settlement lifetime.
Final gate cleanup
6d6272107d9d967979d27602eb342c9b75294cb3only renames a shadowed local and removes explicit relay fixture arguments equal to its defaults. It passed a fresh P2 delta review and scoped lint. Existing focused runtime/type/import proof remains valid. The corrected custom-store regression was also rerun with the original digest owner: both cases failed for the intended reason (zero sends / obsolete recipient), 154.53s wall time; the passing candidate source was restored byte-for-byte.The Plugin SDK API report completed successfully for integrated main
fc1b2e66564eversus runtime candidate19ef02430154(digest5b83b330). It reports zero public entrypoint or direct signature changes; all 131 notices are internal declaration-closure changes. The declaration collector conservatively includes whole internal modules under wildcard sections: voice store types enter via transcript-worker lookup/match types, and Gateway admission is an implementation dependency. Neither released tag exposes the changed voice persistence functions as SDK/runtime operations, and the package exports maps contain no wildcard export. No compatibility shim or deprecation record is required. The final naming/default-argument cleanup changes no API declaration input. Runtime process graph (10 tests), get-reply import closure (1 test), and compiled PR-wrapper inventory (1 test) passed; all storage/line-count ratchets passed with 0 new environment names.ClawSweeper review of
19ef02430154completed with no actionable runtime findings and confirmed the custom-store P1 resolved. Its only next step was the PR heading, now corrected. CI on that head passed every Node shard and type lane; the sole code failure was the shadowed local fixed above. The final head passed fresh CI and ClawSweeper admission; non-required checks did not gate landing.Landed
Merged through native
scripts/prasd60f85fb9771bea5d3c9f79b95413591aed25b1don 2026-10-08. Final-head CI passed, including the enforced CI/security gate. ClawSweeper reviewed6d6272107d9d967979d27602eb342c9b75294cb3at 18:03 UTC with no findings or before-merge items. No admin exception was needed.