Skip to content

refactor(media): consume resolved provider and plugin config - #177454

Merged
steipete merged 3 commits into
mainfrom
deslop/z37-2-plugin-media-config-20261015
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/z37-2-plugin-media-config-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Removed downstream work Existing owner and provenance Accepted edge case
Five private web-search config readers Existing resolveProviderWebSearchPluginConfig SDK accessor; #52629 / #57317 / #49200 / aa28d1c / #130212 No relaxed input boundary: the shared SDK still validates the unknown plugin root/child; credential and field parsing remain plugin-owned.
Repeated image-provider object/array checks and duplicate ID scan Config validation and shared selector; image auto-registration #51392 Fabricated malformed typed maps are no longer ignored. Optional models/input remain supported because active config-write secrets preflight reads source config before model materialization. First matching provider/model behavior, blank-ID handling, alias ordering, and audio/video projection remain.
Media maxChars/maxBytes/concurrency type/range checks, scope enum normalization, preferred-model trim ToolsMediaSchema and allow/deny schema; current resolver consolidation #175834 Callers bypassing config validation no longer receive silent repair. External message context, prompt text, timer conversions, optional defaults, and access decisions remain owned where they are used.
Generated-media global max-byte numeric checks agents.defaults.mediaMaxMb positive-number schema; #66240 Fabricated invalid global limits no longer fall back silently. Opaque channel config and byte representability bounds remain checked.
Ollama missing-required-model-field fallbacks Canonical model materializer and required provider-runtime Model contract Direct consumers must provide complete typed model definitions. #173844's real reported repetition/output failures (#138245, #44965) remain protected by all output caps, request/native precedence, and repetition machinery. Only three impossible missing-cap test rows are removed.
MiniMax missing-required-maxTokens path Required runtime Model contract; #160089, moved by #177170 Incomplete fabricated models no longer get a replacement cap. Small-cap signed replay uplift, requested output bounds, default effort, and signed replay tests remain.
Voice-call repeated internal streaming defaults and stored limit projections VoiceCallConfigSchema streaming defaults; webhook is sole production MediaStreamHandler constructor; 1d8968c Internal constructors must supply four resolved positive-integer limits; fixtures now use the config owner. Admission/per-IP/total socket caps and timer overflow clamping remain at their effects.
Voice-call required serve/tunnel/transcript defaults and inbound key retrim VoiceCallConfigSchema / errand-config trim+min1 Invalid hand-built internal configs are no longer repaired twice. The published runtime constructor still resolves config/env for direct callers; raw plugin input, provider credentials, and phone parsing remain boundaries.
Ollama private discovery config reader/cast Existing resolvePluginConfigObject SDK owner; fbbd644 Object validation and captured policy remain SDK-owned; discovery model/context/output policies remain plugin-owned.
File-transfer runtime nested object walk Same SDK owner; #74742 No authorization/path/policy check is removed. Only the top-level config lookup moves to the existing shared owner; source/mutation readers remain.
Memory CLI, dreaming-status and CLI-recall config walks Same SDK owner; #114013 Payload parsing and all mutation/locking/authority paths remain unchanged. The SDK preserves payload identity across captured revisions.
Firecrawl webFetch casts and fetch-credential envelope walk Same SDK owner; aa28d1c Nested webFetch parsing, secret resolution and search/fetch credential precedence remain.
XAI code-execution config lookup/cast Same SDK owner; 2879f76 The existing nested object boundary and enabled/auth policy remain; no payload fields are defaulted by the accessor.
Voice-call store config lookup Same SDK owner; #164330 Both package IDs, authored store-path normalization and migration/state protection remain.

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 complete satisfies ProviderRuntimeModel fixture 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 --check pass. Runtime value cycles and Madge static cycles are both zero. This slice cherry-picked without conflicts onto fresh main 11d0c854192; 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.ts passes 13/14; its allowlist case observes 98 suppressions against 97 because unchanged src/gateway/session-row-scope.ts adds unicorn/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.

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.
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T17:37:39.259944Z f2f5797 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The stream resolves num_predict through a fallback expression and sends 3072.
  • After: The stream reads the resolved model cap directly and still sends 3072.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and source-reviewed without actionable findings; validation is focused and reported, with no shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence reports focused provider/media tests and static checks, with no new live-product claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Repeated consumer-side config decisions increase the chance that provider and media behavior drifts from its authoritative owner.
Reason: The maintainer-authored direction is approved, and the diff removes duplicate policy without adding settings, public interfaces, or competing state.

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
Reviewed head: b0540370fc7693225fa9978095e52079b612ac26

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied validation covers focused tests and static checks, without a shipped-entry-point run of this refactor.
Agent review details

How this fits together

Config 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
Loading

Technical review

Best 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

  • Configured image-provider discovery keeps the original intent (1687c67: Deduplicate image-capable provider discovery while retaining automatic registration for configured vision models.)
  • Media defaults and provider ordering keeps the original intent (7189b49: Move media defaults into plugin manifests while keeping configured image providers available.)
  • Media resolver normalization changes intended behavior with a stated reason (5fe1414: Keep private operations with their existing owners; this PR explicitly delegates typed-value validation to the config schema.)
  • Plugin web-search readers keeps the original intent (refactor(providers): deslop small provider plugins #158437: Consolidate small provider plugins while preserving credentials, configuration, and request contracts.)
  • Ollama output caps and required model fields changes intended behavior with a stated reason (b14f705: Send resolved output caps to native Ollama and preserve local versus hosted output budgets; this PR explicitly removes only missing-required-field fallback behavior.)
  • MiniMax signed replay changes intended behavior with a stated reason (fix(minimax): honor M3.1 thinking effort levels #160089: Preserve signed thinking history during client normalization while restoring configured and requested wire caps; the small-cap uplift remains.)
  • Voice-call stream bounds changes intended behavior with a stated reason (1d8968c: Bound unauthenticated pending sockets and total connections; this PR removes duplicate defaults while retaining schema-supplied limits and enforcement.)
  • Generated-media configured limits keeps the original intent (fix(media): honor configured store limits #66240: Honor configured agent media limits instead of prematurely applying the store default.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -118, Tests -3. Total -121 across 28 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 20 91 209 -118
Tests 8 38 41 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 129 250 -121

Labels

Label changes:

  • add P3: This is behavior-preserving maintenance with no established current user-facing failure.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is behavior-preserving maintenance with no established current user-facing failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 12:23 PM ET / 16:23 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution for f2f57975b6cc63a71187fbc503ee6d72909eab8b, run 39295283996, attempt 1:

Failed job Attribution
checks-fast-baseline-ratchets (118206931746) Inherited obsolete allowance for the retired ACPX acp-runtime-backend mock. Fixture, SDK module, checker, scanner and baseline are byte-identical between CI main parent 4ec61b4ed2a8a5f05f041372726fe62f2706584c and tested merge ec0537644f71a1a9d2dc2c18ab23701de981fca8. Main already prunes precisely this row in c2fa320046af489667d7b8a997ab223435d9e431. No PR hunk reaches the static violation.
openclaw/ci-gate (118214487995) Aggregate of that sole failed leaf.

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.

@steipete
steipete merged commit 2307781 into main Oct 19, 2026
137 of 143 checks passed
@steipete
steipete deleted the deslop/z37-2-plugin-media-config-20261015 branch October 19, 2026 18:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…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
RomneyDa added a commit that referenced this pull request Nov 10, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call extensions: duckduckgo extensions: firecrawl extensions: memory-core Extension: memory-core extensions: minimax extensions: ollama extensions: searxng extensions: tavily extensions: xai P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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