fix(gateway): dedupe TTS status provider diagnostics [AI-assisted]#93868
fix(gateway): dedupe TTS status provider diagnostics [AI-assisted]#93868harjothkhara wants to merge 3 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 7:55 PM ET / 23:55 UTC. Summary PR surface: Source +47, Tests +151. Total +198 across 4 files. Reproducibility: yes. at source level: the linked issue provides a concrete cold-start Gateway fanout procedure and the synchronous provider diagnostics explain the reported event-loop occupancy. The PR also supplies an after-fix real Gateway run, although this review did not independently execute the untrusted branch. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Rebase onto current main while preserving the one-pass inventory, alias behavior, canonical provider timeouts, and unchanged Do we have a high-confidence way to reproduce the issue? Yes at source level: the linked issue provides a concrete cold-start Gateway fanout procedure and the synchronous provider diagnostics explain the reported event-loop occupancy. The PR also supplies an after-fix real Gateway run, although this review did not independently execute the untrusted branch. Is this the best way to solve the issue? Yes: reusing one config-aware provider inventory inside AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1eaf536728a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +47, Tests +151. Total +198 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (6 earlier review cycles)
|
c39c811 to
b249647
Compare
|
I think the fix would involve adjusting ui. Would that work for your use case? |
|
Fixed both CI failures: On the proof gate: this is a no-output perf change — it dedupes the |
|
Added the missing real Gateway proof to the PR body. Proof summary: I started an isolated source Gateway on this PR branch, removed No code changes in this refresh. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
b249647 to
f10f552
Compare
f10f552 to
571e1bc
Compare
571e1bc to
95f3db5
Compare
|
Addressed the current-head timeout-semantics blocker and rebased onto current
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Fixes #81355.
This keeps the already-merged
applyPluginAutoEnablecache fix intact and addresses the remainingtts.statusGateway hot path. The status handler now yields once before synchronous provider diagnostics, builds the config-aware speech provider inventory once, and reuses that same inventory/configured-state pass for bothproviderStatesand fallback filtering.Best-fix rationale: this preserves the existing
tts.statusresponse shape and config-aware provider inventory contract, avoids changing the synchronousSpeechProviderPlugin.isConfiguredSDK contract, and keeps the blast radius totts.statusplus the provider-order helper.Real behavior proof
Behavior addressed:
tts.statusno longer performs duplicate provider inventory/configured-state work before responding, and it yields before provider diagnostics so sibling Gateway RPCs can run.Real environment tested: Local OpenClaw source checkout on this PR branch with an isolated real Gateway process, temp HOME/state/config, normal Gateway WebSocket client, real speech-provider plugin metadata loading enabled, and channel/background sidecars skipped. This was not a mocked handler call.
Exact steps or command run after this patch:
node --import tsx --input-type=module -e '<isolated Gateway tts.status proof using test/helpers/openclaw-test-instance.ts and src/gateway/test-helpers.e2e.ts>'messages.tts.provider: "openai"withmessages.tts.providers.openai.apiKey: "test-openai-key"andmessages.tts.providers.microsoft: {}; the Gateway env removedOPENCLAW_SKIP_PROVIDERS, setOPENCLAW_TEST_MINIMAL_GATEWAY=0, and kept channel sidecars skipped through the existing test helper.node scripts/run-vitest.mjs src/gateway/server-methods/tts.test.ts packages/speech-core/src/tts.test.ts src/tts/provider-registry.test.ts src/plugins/contracts/tts.contract.test.ts src/plugins/capability-provider-runtime.test.tsgit diff --checkgh pr checks 93868 --repo openclaw/openclaw --watch=falseEvidence after fix:
{ "ok": true, "branch": "codex/81355-tts-status-provider-diagnostics", "providerIds": ["microsoft", "openai"], "secondProviderIds": ["microsoft", "openai"], "providerStateCount": 2, "configuredProviders": ["microsoft", "openai"], "enabled": true, "provider": "openai", "fallbackProvider": "microsoft", "fallbackProviders": ["microsoft"], "prefsPathSuffix": ".openclaw/settings/tts.json", "firstElapsedMs": 320, "secondElapsedMs": 1, "totalElapsedMs": 6527, "siblingTurnBeforeCompletion": true, "stableProviderStates": true }Focused Vitest proof also passed 5 shards. The active-registry probe returned
ok: true,elapsedMs: 3,immediateAtRespond: true, andproviderStates: ["openai", "acme-speech"]. Current PR checks are green, includingCritical Quality (gateway-runtime-boundary),check-lint,check-additional-boundaries-a,Real behavior proof, and the Node/core CI shards selected for this diff.Observed result after fix: In a running Gateway,
tts.statusresponds successfully over the normal WebSocket RPC path, reports real provider diagnostics for configured speech providers, preserves the public status shape and configured provider, returns the expected fallback list, and keeps provider diagnostics stable across repeated calls. The local sibling event-loop turn completed before the status call finished, matching the intended pre-diagnostics yield.What was not tested: No live Control UI browser/dashboard session and no external TTS synthesis request were exercised. The real Gateway proof used fake local provider config only to satisfy configured-state diagnostics and did not call external provider APIs.
Tests and validation
node --import tsx --input-type=module -e '<isolated Gateway tts.status proof using test/helpers/openclaw-test-instance.ts and src/gateway/test-helpers.e2e.ts>'node scripts/run-vitest.mjs src/gateway/server-methods/tts.test.ts packages/speech-core/src/tts.test.ts src/tts/provider-registry.test.ts src/plugins/contracts/tts.contract.test.ts src/plugins/capability-provider-runtime.test.tsgit diff --checkgh pr checks 93868 --repo openclaw/openclaw --watch=falseRisk checklist
tts.statuspayload shapeisConfiguredsync contractapplyPluginAutoEnablecache pathCurrent review state
Stage 2 blind review completed:
listSpeechProviders(cfg)as the status inventory sourceAutoreview completed cleanly after two accepted findings were fixed:
never[]AI-assisted: this PR was implemented with Codex assistance; the human author should review and own the final diff before marking ready.