Skip to content

fix(talk): keep mode updates independent of speech startup - #138045

Merged
steipete merged 1 commit into
mainfrom
fix/talk-mode-provider-loading
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/talk-mode-provider-loading

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135808

What Problem This Solves

Talk mode synchronization could wait for, or fail because of, unrelated speech-provider initialization. Validating a mode request and broadcasting its state must not require loading speech synthesis, provider catalogs, or realtime sessions.

Owner Repair

Move the existing handler into one lightweight lazy core family. The connected-Talk-node restriction for webchat, validation order, operator.talk scope, broadcast, and response are unchanged. The old handler is deleted. There is no retry, larger timeout, provider fallback, new public method, configuration option, or storage change.

The current-main refresh preserves the new Gateway dispatcher and request-entry preparation lifetime. The registration now lives only in the canonical core-handlers.ts table, not the retired table in server-methods.ts. Main's early Talk catalog agent-ownership check also remains intact. The validated parameter type removes two unnecessary assertions and tightens the old Talk assertion baseline from seven to five.

Validation

Current source-bound candidate against main 3ed226a746a8efd223a35a81790014c41ff044a3:

  • All 59 tests passed across five files: the seven lazy-family cases, descriptor/registry/method-list coverage, and thirteen request-entry lifecycle cases covering suspended preparation, authorization, shutdown, and replacement. No skips; 313.382 seconds.
  • Fresh independent Codex review: scoped-clean P0–P3, no actionable findings. It reviewed the current dispatcher/lifetime composition, not just the old extraction.
  • Full pnpm build passed all sixteen phases in 878.061 seconds, including public declarations, plugin runtime packaging, import checks, runtime post-build verification, and UI output. This was a fresh task-owned source/build tree with a normal frozen install reusing the package store, not a clean-cache claim. The build metadata records base 3ed226a; source hashes bind the applied candidate patch.
  • The full canonical changed-path gate passed all 30 selected stages in 1,579.332 seconds, within its original deadline. Its moving-ref comparison was retained explicitly: the two ratchets and the test-temp report were separately rechecked against fixed base 3ed226a, with the temp report including the complete committed candidate. All three passed without changing guard predicates. Refreshed-head CI and the native landing gates remain required.

A real full-Gateway client probe also passed in 3.037 seconds: one authenticated operator.talk connection sent mode on/listening and off/idle, both successful responses exactly matched their actual broadcasts, event sequence increased, and the socket closed cleanly. The provider observer recorded zero call allocations before/after. This used the built Watch feature composition d3b3eb72, whose mode handler, lazy registration, descriptor, dispatcher, and request-entry owner were verified byte-identical to this PR’s 318bfad2 head. It proves the real Talk-mode RPC/broadcast path, not physical-Watch, microphone, media, or provider-call behavior.

Historical proof is retained, not relabeled current-head proof. The dependency-boundary regression produced four intended failures on the old owner with three unaffected controls, then passed unchanged after extraction. A separate four-file authentication/integration group passed all 146 tests with the feature composition, including embedded WebSocket and Watch HTTP mode requests. That is synthetic client/Gateway integration evidence, not a physical-Watch or live-provider claim. The original intermittent cold-run timeout did not identify its exact suspended RPC; the deterministic dependency-failure regression proves the owner defect independently.

The prior b41393e candidate completed all seven remaining canonical guards and a full local build after the aggregate changed gate hit its fixed deadline. Exact-head CI attempt two passed after retrying a transient advisory-audit network exhaustion; the original incomplete audit result is preserved, not presented as a vulnerability finding or a successful audit. These are historical results until the current composition completes its own gates.

Scope and Release-note Context

Talk mode now synchronizes independently of speech-provider availability for all Talk clients. Speech synthesis, catalogs, and realtime creation still load their existing owner when requested.

Current delta: production +35/−23 (net +12), tests +70/−0, ratchet metadata +1/−1. The production growth is the separately lazy-loadable owner and its registration, absorbing the original handler rather than adding a parallel path. No dependency, lockfile, public protocol, configuration, or storage change.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review September 4, 2026 07:48
@steipete steipete self-assigned this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 3:58 AM ET / 07:58 UTC.

ClawSweeper review

What this changes

Separates Talk mode synchronization from speech-provider loading and adds regression coverage for successful and rejected mode requests.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful repair absent from current main and v2026.8.2. No actionable correctness findings were found.

Priority: P2
Reviewed head: b41393e32587c9a15e95a25bd7568b03b27103d6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused architectural repair with useful regression coverage and no identified correctness defects.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored loading repair is exempt from the contributor-proof gate and changes no authority boundary; reported WebSocket/Watch integration results are supplemental, not a native-device or live-provider proof claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored loading repair is exempt from the contributor-proof gate and changes no authority boundary; reported WebSocket/Watch integration results are supplemental, not a native-device or live-provider proof claim.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff moves the existing mode handler, updates its lazy-family registration, adds four regression cases, and tightens the assertion baseline. Catalog changes visible in endpoint comparisons are outside this introduced delta.
Current-main defect boundary: Current main still assigns talk.mode to the broad talk family. That module statically imports speech synthesis and realtime handlers; lazy dispatch awaits the family import before invoking the requested handler.
Latest-release comparison: v2026.8.2 contains both the static synthesis import and talk.mode in the same module, so the latest supplied release does not contain this isolation.
Findings None None.
Security None None.

How this fits together

Talk clients send mode changes to the Gateway, which validates requests and broadcasts the resulting state to eligible connected clients. Speech synthesis and realtime sessions have separate responsibilities.

flowchart TD
  A[Talk client] --> B[Gateway authorization]
  B --> C[Lazy method dispatch]
  C --> D[Mode validation and node check]
  D --> E[Scoped broadcast and response]
  D --> F[Request error]
  C --> G[Speech and realtime handlers]
Loading

Before merge

  • Resolve merge risk (P1) - The captured validation does not yet establish the built module graph; the full build and seven interrupted or unrun guards remain unverified.
  • Complete next step (P2) - Complete and record the seven remaining canonical guards and full module-graph build identified in the PR body.
Agent review details

Security

None.

PR surface

Source +13, Tests +70, Other 0. Total +83 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 36 23 +13
Tests 1 70 0 +70
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 6 107 24 +83

Review metrics

Metric Value Why it matters
Production versus test growth Production net +13 lines; tests +70; assertion allowance reduced by 2 The handler is moved rather than duplicated; remaining production growth establishes the independent lazy-loading boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one lightweight mode handler on the existing lazy dispatcher; the additional imports and registration are justified isolation overhead.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one lightweight mode handler on the existing lazy dispatcher; the additional imports and registration are justified isolation overhead.

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

Yes, source establishes that a speech-module import failure prevents current-main talk.mode dispatch; the new fault-injection cases target that boundary. The historical cold timeout's precise cause remains unproven.

Is this the best way to solve the issue?

Yes. Extracting the existing handler reuses established lazy dispatch and removes the unnecessary dependency without retries, duplicated policy, or client timeout changes.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Repairs a bounded Talk synchronization failure caused by unrelated speech-module loading.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored loading repair is exempt from the contributor-proof gate and changes no authority boundary; reported WebSocket/Watch integration results are supplemental, not a native-device or live-provider proof claim.

Label justifications:

  • P2: Repairs a bounded Talk synchronization failure caused by unrelated speech-module loading.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored loading repair is exempt from the contributor-proof gate and changes no authority boundary; reported WebSocket/Watch integration results are supplemental, not a native-device or live-provider proof claim.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff moves the existing mode handler, updates its lazy-family registration, adds four regression cases, and tightens the assertion baseline. Catalog changes visible in endpoint comparisons are outside this introduced delta. (src/gateway/server-methods/talk-mode.ts:10, b41393e32587)
  • Current-main defect boundary: Current main still assigns talk.mode to the broad talk family. That module statically imports speech synthesis and realtime handlers; lazy dispatch awaits the family import before invoking the requested handler. (src/gateway/server-methods/talk.ts:63, fa70549fe460)
  • Latest-release comparison: v2026.8.2 contains both the static synthesis import and talk.mode in the same module, so the latest supplied release does not contain this isolation. (src/gateway/server-methods/talk.ts:927, 0965053fe6b9)
  • Preserved contract and security boundary: The descriptor retains operator.talk. The extracted handler preserves the webchat node check, validation order, payload, and dropIfSlow broadcast. The unchanged broadcaster continues enforcing Talk event scopes. Its runtime imports are OpenClaw protocol and validation modules; no Codex contract is implicated. (src/gateway/methods/core-descriptors.ts:125, b41393e32587)
  • Caller and regression coverage: The iOS caller sends enabled/phase through talk.mode. New tests invoke the actual lazy handler with synthesis import failure injected, covering paired clients, webchat with and without a Talk node, and invalid parameters. Existing mobile-bootstrap integration coverage sends the same RPC over an authenticated WebSocket. (src/gateway/server-methods/lazy-core-handlers.test.ts:21, b41393e32587)
  • Existing abstraction and historical routing: The existing lazy-family helper supplies import isolation and promise sharing; chat cancellation already uses a separate lightweight family. Blame and comparison against the helper commit's raw recorded parent support routing to Peter Steinberger. This establishes helper history, not the original cause of the Talk coupling. (src/gateway/server-methods/lazy-core-handlers.ts:21, 4319ddbe8cb0)

Likely related people:

  • Peter Steinberger: Raw commit 4319ddb adds src/gateway/server-methods/lazy-core-handlers.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4319ddbe8cb0; files: src/gateway/server-methods/lazy-core-handlers.ts)

Rank-up moves

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

  • Record successful completion of the remaining seven canonical guards and full module-graph build.

Rating scale

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

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

Workflow

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

@steipete
steipete force-pushed the fix/talk-mode-provider-loading branch from b41393e to 318bfad Compare September 4, 2026 09:04
@steipete
steipete merged commit adbc93e into main Sep 4, 2026
189 of 192 checks passed
@steipete
steipete deleted the fix/talk-mode-provider-loading branch September 4, 2026 09:43
@steipete

steipete commented Sep 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 Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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