Repository navigation
improve(xai): defer optional capability runtimes - #119374
Conversation
0cdd90a to
00db86b
Compare
00db86b to
c320b61
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 11:18 PM ET / August 5, 2026, 03:18 UTC. ClawSweeper reviewWhat this changesThe branch replaces eager xAI media, OAuth, speech, video, transcription, and realtime-voice runtime imports with cached lazy facades, plus a narrow private audio-queue SDK seam. Merge readinessThis maintainership-owned PR is still necessary: current main eagerly constructs optional xAI capabilities at registration, while the proposed facades defer those runtimes until use. No actionable patch defect was found, but exact-head CI and maintainer sign-off remain required. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw registers the bundled xAI plugin at startup so its provider metadata can be discovered. Optional capability requests then invoke the relevant xAI runtime, including realtime voice and transcription session setup. flowchart LR
A[OpenClaw startup] --> B[xAI plugin registration]
B --> C[Lightweight capability metadata]
C --> D[Optional capability request]
D --> E[Cached lazy runtime]
E --> F[Media result or realtime session]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +790, Tests +887, Docs +1, Config +7, Other +2. Total +1687 across 32 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge after exact-head CI is green and a maintainer accepts the first-use lifecycle behavior as preserving xAI capability semantics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR improves optional xAI startup behavior rather than repairing a reported current-main failure. Is this the best way to solve the issue? Yes. Current main eagerly creates the optional providers, while the plugin-local facades retain synchronous metadata and defer only capability runtimes; this is preferable to a provider-specific core workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1f3d45b76f51. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
e53a266 to
e509f1b
Compare
351eaba to
cd6f6bc
Compare
cd6f6bc to
cdb3bcb
Compare
Punchcard-Session: coral-workshop-workshop-3f
cdb3bcb to
31283a6
Compare
|
ClawSweeper merge-gate resolution for reviewed head
All listed |
|
Merged via squash.
|
* origin/main: fix(channels): honor explicit preview streaming settings refactor(telegram): consolidate outbound contracts and targets (#119438) fix(qa): retry transport cleanup and always stop owned labs (#119442) fix(mcp): guard stdio stdout frame parsing against oversized-buffer crash (#119379) refactor(auto-reply): centralize delivery deduplication and routing (#119436) fix(qa): preserve scenario isolation in serial suites (#119439) perf(xai): lazy-load optional capability runtimes (#119374) refactor(browser): consolidate browser CLI and normalization helpers (#119432) fix(qa): require ready transport accounts (#119431) refactor(media): share image and video geometry normalization (#119416) fix(config): preserve plugin metadata for missing config (#119421) fix: retry delivery when outbound adapter is unavailable (#119371) fix(cli): retire invalid secret flags and prove doctor recovery (#118926) refactor(signal): share outbound and reaction transport (#119415)
Punchcard-Session: coral-workshop-workshop-3f
What Problem This Solves
Loading the bundled xAI plugin eagerly pulled image, video, speech, transcription, realtime voice, and OAuth runtimes into ordinary startup even when none of those optional capabilities were used. That made xAI one of the largest avoidable contributors to plugin import time and RSS.
Root Cause And Owner
The xAI registration entrypoint owned runtime construction, static capability metadata, config validation, auth routing, and realtime startup buffering in one eager import graph. The architectural owner is the xAI plugin boundary. Core only gains a narrow production-private audio-queue SDK seam needed by lazy bundled-provider facades.
Canonical Fix
The plugin now registers lightweight metadata-compatible facades synchronously and loads each heavy capability runtime once, on first use. Synchronous validation, provider routing, bounded pre-connect buffers, and close-before-load cleanup stay at the owning xAI boundary.
Realtime voice uses one provider bridge per explicit wrapper generation. All provider callbacks are generation-bound, stale bridges cannot notify or mutate their replacements, startup operations drain in original order, and flush failures emit one terminal error before closing. Audio, user-message, and tool-result queues remain byte/count bounded until direct forwarding begins.
Connected eager policy was removed from the registration path and split into metadata, routing, auth-runtime, and capability-runtime owners. Non-goals: no config, protocol, auth choice, model routing, or storage contract changes. The separate realtime retention work in #116201 is not claimed by this PR.
User Impact
Operators who enable xAI but do not use its optional media, speech, or realtime capabilities pay substantially less startup cost. First capability use loads the same runtime implementation and subsequent calls reuse it.
Evidence
31283a6ea3eb86841a7a9a2a1478bc47a2cf080c, rebased onto866dade2462f0cbb4b6a617cabe09dd5cc6dd2ea: 21 lazy-lifecycle tests and 10 shared realtime SDK tests passed. Formatting andgit diff --checkare clean.22accece326d518a28a3a0228a6b5990f8c1850378dc1550553c7e0dec83cba4; the rewritten commit remains signed and retains its Punchcard trailer.ui/configfiles resolved it without a source change.30971443364is in progress. Exact-head ClawSweeper dispatch30971442098succeeded; its current-headBefore mergeandRank-up movesremain a hard pre-merge gate.17ef7771a66d21af51d26558a9a01ec7d01a227dadds two post-base commits with zero touched-file overlap;git merge-tree --write-treeproduced a clean merge result.Merge Gate
Do not merge until exact-head required CI is green and the latest ClawSweeper comment has no unresolved
Before mergeorRank-up movesitems. Every move must be applied or answered in the PR before merge.AI-assisted: yes. The implementation was manually reviewed, focused and broad tests were run, and structured autoreview completed cleanly.
Punchcard-Session: coral-workshop-workshop-3f