Repository navigation
refactor(media): consume resolved provider and plugin config - #177454
Conversation
Share configured image-provider selection and SDK web-search config access. Remove downstream validation/defaulting of resolved media limits, provider model fields and voice-call settings; retain raw source-config preflight handling, public runtime entrypoint normalization and resource/security boundaries.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR reuses shared config readers and removes repeated validation and defaults from media, provider, and voice-call consumers. Example: A native Ollama model has maxTokens set to 3072.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-approved refactor consolidates existing config ownership, and source review found no actionable regression. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherConfig schemas and model builders supply validated settings to media registries, provider request builders, and voice-call handlers, which produce provider requests and bounded media streams. flowchart TD
A[Authored config] --> B[Config schemas and model builders]
B --> C[Shared config readers]
C --> D[Media provider selection]
B --> E[Provider request builders]
B --> F[Voice call stream handler]
D --> E
Technical reviewBest possible solution: Retain schema and model-builder ownership while merging this focused consumer simplification after the existing CI gates pass. Do we have a high-confidence way to reproduce the issue? This PR proposes a refactor rather than a bug reproduction; inspection confirms the removed checks duplicate existing schema or model-builder contracts. Is this the best way to solve the issue? The change uses existing owners, migrates all affected internal callers, and preserves distinct alias, raw-config, timer, and request-precedence contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b78b230a1c1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -118, Tests -3. Total -121 across 28 files. Added test files: 0. View PR surface stats
LabelsLabel 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 Reviewed October 19, 2026, 12:23 PM ET / 16:23 UTC. |
|
Exact-head CI attribution for
All other planned CI leaves passed, including all three PostgreSQL shards, types, lint, changed tests, UI E2E and independent security checks. Full exact-head check census includes only superseded advisory bot cancellations, not missing CI suites. The six completed scheduled main runs and coordinator flake ledger were checked; this is not the old process-census signature. Expanded focused local proof passed 187/187 across 14 files; targeted types/lint, assertion shrink ratchet and runtime/static cycles passed. Independent review is scoped-clean. The separately recorded local suppression-baseline mismatch remains inherited and is not claimed fixed. Landing uses the campaign-authorized native inherited-failure exception, pinned to the reviewed head. CI is not being described as green, and no CI rerun or branch refresh was requested just to obtain green. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…w#177454) * refactor(media): consume resolved provider and plugin config Share configured image-provider selection and SDK web-search config access. Remove downstream validation/defaulting of resolved media limits, provider model fields and voice-call settings; retain raw source-config preflight handling, public runtime entrypoint normalization and resource/security boundaries. * test(media): complete canonical runtime model fixtures * refactor(plugins): reuse runtime config accessors
Models without an authored, catalog, or provider output limit use the shared context-sized 32768 default rather than an invented 8192/4096 cap. Preserve explicit limits and add informational, non-mutating Doctor guidance for saved former onboarding defaults. Release adaptation: preserve release discovery/normalization and provider factory layouts, the Mistral safe repair ceiling, Azure wizard defaults, LM Studio served context, and existing SDK entrypoints. Port only the Ollama cloud budget facts/helper and native num_predict ownership needed by this change; keep explicit request and model-parameter precedence. Do not import the broad #173844 repetition guard or #177454 refactor. Use the baseline Doctor information renderer and factories without unsupported docsUrl or main-only finding-storage assumptions. Add release-native config-to-request and discovered/native output cap proof. Carry known hosted routes through existing Ollama fallback, dynamic, and setup builders, preserving bare local model behavior. Resolve the cloud reference helper through the baseline provider-model-shared SDK export. (cherry picked from commit 94e6734) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: VACInc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Media and provider consumers repeat typed config checks, image-provider scans, and defaults already supplied by their config owner.
User Impact
No intended behavior change or new settings. Preserve regional provider aliases, caller-specific media defaults, model output caps and repetition protection, MiniMax signed replay, voice-call connection caps, and timer bounds.
Why This Change Was Made
Use the SDK web-search config accessor in five plugins. Share image-capable configured-provider selection while keeping canonical registration IDs distinct from execution aliases. Read schema-validated media limits, scope actions, concurrency, and preferred models directly. Consume required Ollama/MiniMax model fields and voice-call's resolved internal streaming/serve/tunnel/transcript fields without defaulting them a second time.
This is the plugin/media area slice, separate from the cross-cutting MCP/core reader cleanup so hosted failures remain attributable. Net production reduction: 143 lines (117 added, 260 deleted; tests/support excluded). The follow-up consolidates nine more runtime lookup sites through the existing plugin-config SDK owner without widening its public contract.
Best-effort tradeoffs accepted
No removed duplicate is supported by an evidenced human malformed-canonical-config report. Existing real safeguards and public contracts are preserved.
Evidence
The next exact-head run exposed two attributable items: an incomplete voice-call runtime stub produced a 30000ms rather than 180000ms polling window, and Firecrawl's assertion baseline needed to shrink after a removed cast. The stub now uses the production normalizer and supplies its scenario-specific 120000ms transcript timeout, with every polling/completion/failure assertion intact. Zero-count assertion rows from the additional reader cuts are deleted, not waived. Expanded targeted types pass. A SessionShare lookup candidate was dropped because its real deeply readonly snapshot contract is not accepted by the existing accessor; no cast or public API widening was added. Expanded independent review is scoped-clean. Expanded focused proof passes 187/187 across 14 files, including the repaired voice-call flow, SDK capture/validation, Doctor state migration, CLI/dreaming/search consumers, file-transfer policy, Firecrawl tools, XAI execution and Ollama discovery. All six serial shards and final compiler-generation verification completed successfully.
That run also reports the unchanged main-only mock-export fixture at
src/infra/openclaw-process-census.missing-command.test.ts:12, introduced by #177407; it is not changed by this PR. Exact-head post-repair CI remains the broad gate, with no rerun requested for green.Final repair checks: expanded source-backed lint, assertion-safety shrink ratchet, runtime value cycles (0), static Madge cycles (0), format and diff checks pass. The one import-layout finding was formatted without changing behavior. The suppression replay remains 13 passed / 1 failed with exactly the previously recorded inherited session-row-scope signature; no baseline or suppression was weakened.
CI follow-up: the first exact-head run exposed a missing type-only test import and two incomplete Ollama discovery mock models. Repair 93228a3 supplies complete models with the existing fixture owner while preserving names and explicit sizing, and restores the import. Targeted test types and lint pass; the initial repair replay passed 58/58, and the final Ollama fixture replay passed 50/50. Independent repair reviews are clean. An existing model-context fixture moved unchanged to the sibling test-support owner to satisfy the oversized-file growth ratchet without reducing coverage. The suppression replay still has only the inherited signature below. Exact-head CI on the repaired commit is the remaining broad gate.
Focused proof used
node scripts/run-vitest.mjs ... --maxWorkers=1, serially with nice 10 and isolated HOME/OpenClaw/XDG state. The expanded 33-file batch passed 396 cases and exposed two Ollama thinking failures: an old cast fixture omitted required runtime-model fields. Replacing it with a completesatisfies ProviderRuntimeModelfixture removed nine model casts without weakening assertions. The final eight-file replay passed 186/186, including 105 Ollama stream/thinking cases and source-config media registry coverage. MiniMax, voice-call, web-search plugin config and media consumers passed in the earlier focused batches; all five prompt-prefix stability cases passed.Targeted 47-production-root typecheck, core/plugin/test lint, format and
git diff --checkpass. Runtime value cycles and Madge static cycles are both zero. This slice cherry-picked without conflicts onto fresh main11d0c854192; frozen prefer-offline install and a fresh 20-production-root media/plugin graph typecheck pass. No production file changed under these areas between the original proof base and this fresh base (only two unrelated test files), so unchanged-input focused proof is reused. Independent isolated review completed with no accepted actionable findings: the media-stream constructor is private under the extensions boundary guide, its sole production caller supplies schema-resolved limits, and public runtime-entry normalization remains. Extension lint used the already typechecked source graph: the standard extension wrapper's broad SDK declaration setup was stopped, and package-artifact boundary validation is deferred to CI. No broad local suite or product build was run; exact-head PR CI is the broad gate.Known inherited local check:
test/scripts/lint-suppressions.test.tspasses 13/14; its allowlist case observes 98 suppressions against 97 because unchangedsrc/gateway/session-row-scope.tsaddsunicorn/no-new-array. The same signature is reported on scheduled main runs 39261680942 and 39270035500. Neither file is changed here; no suppressions or baselines were added.