Skip to content

Preserve provider settings during onboarding updates - #100107

Merged
steipete merged 6 commits into
openclaw:mainfrom
frank-beans:codex/preserve-provider-timeouts
Jul 5, 2026
Merged

steipete merged 6 commits into
openclaw:mainfrom
frank-beans:codex/preserve-provider-timeouts

Conversation

@frank-beans

@frank-beans frank-beans commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Provider onboarding can refresh a provider's model catalog/config and accidentally drop provider-level settings that are not repeated in the new provider patch. In the observed OMLX/iMessage failure, losing models.providers.omlx.timeoutSeconds made long-running local/VLM work fall back to the implicit short provider watchdog after model/provider refreshes.

The first version of this PR preserved those fields with a shallow merge, but ClawSweeper correctly flagged that as too additive for auth-bearing fields. Some provider onboarding paths, including MiniMax, intentionally omit stale/placeholder auth fields such as apiKey so runtime auth discovery can take over. This revision preserves non-auth provider settings like timeoutSeconds while letting provider-owned auth fields (apiKey, auth, headers) be cleared when omitted from the patch.

Summary

  • Preserve existing non-auth provider-level settings when onboarding refreshes provider model configs.
  • Keep untouched provider entries when applying onboarding provider patches.
  • Allow onboarding patches to intentionally clear omitted auth-bearing fields.
  • Add regression coverage for both timeout preservation and MiniMax placeholder apiKey removal.

Evidence

Field Evidence

This PR came from a live OMLX/iMessage regression on a local VLM provider.

Observed broken state:

  • agents.defaults.timeoutSeconds was still configured high, but models.providers.omlx.timeoutSeconds had been dropped from the provider entry after provider/model config refresh.
  • OMLX requests then logged with no provider timeout applied:
    • [model-fetch] start provider=omlx api=openai-completions model=Agents-A1-oQ6-fp16 ... timeoutMs=undefined
  • User-visible failure:
    • LLM request failed. | Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config.

After restoring the provider timeout and applying this merge behavior locally, the same OMLX provider path preserved and used the provider-level timeout:

  • Config values verified:
    • models.providers.omlx.timeoutSeconds = 1200
    • OMLX provider: baseUrl=http://127.0.0.1:8000/v1, api=openai-completions
    • Model row retained input: ["text", "image"]
  • Runtime log showed the provider timeout was actually applied:
    • [model-fetch] start provider=omlx api=openai-completions model=Agents-A1-oQ6-fp16 method=POST url=http://127.0.0.1:8000/v1/chat/completions timeoutMs=1200000 proxy=none policy=custom
    • [model-fetch] response provider=omlx api=openai-completions model=Agents-A1-oQ6-fp16 status=200 ... contentType=text/event-stream; charset=utf-8

Follow-up observation, intentionally out of scope for this PR:

  • Once provider timeout preservation was fixed, a separate hard run ceiling was exposed: agents.defaults.timeoutSeconds=1200 can still abort an active, streaming local-model run at 20 minutes.
  • The diagnostic log showed active stream progress shortly before that abort:
    • activeWorkKind=model_call lastProgress=model_call:stream_progress lastProgressAge=33s
    • followed by embedded run timeout ... timeoutMs=1200000
  • Locally, that was mitigated by making the agent hard-run ceiling much larger while keeping the OMLX provider timeout provider-owned. This PR does not try to change run-lifetime semantics; it only prevents provider-owned timeout settings from being erased during onboarding/provider refresh.

Test Evidence

  • Added shared onboarding regression coverage in src/commands/onboard-auth.config-shared.test.ts:
    • preserves provider-level settings when applying onboarding provider patches proves a provider patch keeps timeoutSeconds and untouched providers.
    • lets onboarding provider patches clear omitted auth fields proves omitted apiKey, auth, and headers are removed while timeoutSeconds is retained.
  • Added MiniMax-specific regression coverage in extensions/minimax/onboard.test.ts:
    • drops placeholder apiKey while preserving provider timeout proves the MiniMax sentinel/placeholder apiKey path does not restore stale auth and still preserves timeoutSeconds.
  • Ran git diff --check locally; it passed.
  • Focused local Vitest execution was attempted, but this fresh checkout had no node_modules; dependency hydration required registry access and was stopped after DNS/network failures in the sandbox. The PR branch is pushed so repository CI can run the authored regression tests in the normal environment.

CI Notes

  • Real behavior proof is passing on the current PR revision.
  • The remaining failing check observed during review is QA Smoke CI. Its failed run is broad smoke coverage, not the proof gate, and reported passed=19 failed=6 total=25 in unrelated end-to-end scenarios such as memory fallback and telemetry/runtime smoke flows. I did not find evidence that those failures are caused by the provider-onboarding merge change in this PR.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 4:39 PM ET / 20:39 UTC.

Summary
The branch changes provider onboarding config merging to retain existing non-auth provider settings and canonical keys, updates MiniMax onboarding alias and SecretRef handling, and adds shared and MiniMax regression tests.

PR surface: Source +94, Tests +251. Total +345 across 4 files.

Reproducibility: yes. Source inspection shows current main replacing models.providers with the onboarding patch, and the PR body includes before/after OMLX logs showing the dropped provider timeout and restored timeoutMs=1200000 behavior.

Review metrics: 2 noteworthy metrics.

  • Provider config merge surface: 1 shared writer changed, 1 MiniMax setup path adjusted. The PR changes a central onboarding helper used by provider setup paths plus a provider-specific alias/SecretRef path.
  • Auth delete-on-omit boundary: 4 root keys + 2 nested request keys. The merge preserves provider settings while clearing omitted apiKey, auth, authHeader, headers, request.auth, and request.headers.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] This intentionally changes persisted models.providers merge semantics during onboarding reruns, so the preserve-versus-clear boundary for provider auth, headers, request fields, and operator settings is compatibility-sensitive.
  • [P1] The final head postdates the maintainer's exact-head proof comment, so merge should rely on exact-head checks and the latest review rather than the older proof comment alone.

Maintainer options:

  1. Land after exact-head validation (recommended)
    Accept the intentional config/auth merge behavior after current-head checks finish, using the added regression coverage and maintainer-reviewed field boundary.
  2. Tighten the auth/config boundary first
    If maintainers want another provider field preserved or cleared, adjust the helper and add a focused shared regression test before merge.
  3. Pause for provider policy review
    Hold the PR if the permanent contract for omitted provider auth fields is still unsettled.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer merge handling for the compatibility-sensitive provider config/auth boundary and exact-head checks.

Maintainer decision needed

  • Question: Should the latest head's provider onboarding contract preserve all existing non-auth provider settings while clearing omitted root and nested credential-bearing fields on rerun?
  • Rationale: The code path writes persisted provider config during onboarding, and the safe auth-clearing boundary is a compatibility-sensitive policy choice even though the patch shape looks correct.
  • Likely owner: steipete — steipete is assigned, authored the current-head follow-up commits, and has recent history in the shared provider onboarding/config boundary.
  • Options:
    • Land after exact-head validation (recommended): Accept the preserve-non-auth and clear-credentials contract once the current head's checks finish green.
    • Tighten the clear/preserve list first: Update the explicit boundary and add focused regression tests if maintainers want additional provider fields preserved or cleared.
    • Pause for broader provider policy: Hold the PR only if omitted provider auth fields need a different permanent onboarding contract.

Security
Cleared: No supply-chain regression was found; the patch touches auth-sensitive config merging but explicitly clears omitted credential-bearing fields and adds regression coverage.

Review details

Best possible solution:

Land the shared onboarding merge behavior after exact-head checks once maintainers accept the explicit boundary: preserve operator-owned provider settings and clear omitted credential-bearing fields.

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

Yes. Source inspection shows current main replacing models.providers with the onboarding patch, and the PR body includes before/after OMLX logs showing the dropped provider timeout and restored timeoutMs=1200000 behavior.

Is this the best way to solve the issue?

Yes. The shared helper is the best fix because provider-specific workarounds would leave sibling onboarding paths exposed, while a shallow merge would risk reviving omitted credential-bearing fields.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority provider onboarding/config bugfix with limited blast radius but real impact for custom or local providers.
  • merge-risk: 🚨 compatibility: The PR changes how persisted models.providers entries are merged during onboarding updates, which can affect existing configs on rerun or upgrade.
  • merge-risk: 🚨 auth-provider: The PR intentionally changes which provider auth, header, and request credential fields are retained or cleared when onboarding patches omit them.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body includes redacted before/after runtime logs for the OMLX provider timeout path, and the current head has a successful Real behavior proof check.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted before/after runtime logs for the OMLX provider timeout path, and the current head has a successful Real behavior proof check.
Evidence reviewed

PR surface:

Source +94, Tests +251. Total +345 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 103 9 +94
Tests 2 251 0 +251
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 354 9 +345

What I checked:

Likely related people:

  • steipete: Recent current-main history shows repeated provider onboarding/config normalization work, this PR is assigned to steipete, and steipete authored most current-head follow-up commits on the auth/config boundary. (role: recent area contributor and likely follow-up owner; confidence: high; commits: 819ff0463a58, 8eeaa45729a3, 00d8d7ead059; files: src/plugin-sdk/provider-onboard.ts, extensions/minimax/onboard.ts)
  • giodl73-repo: Authored the merged PR that preserved configured default model settings in the same shared onboarding helper and adjacent test file. (role: adjacent behavior introducer; confidence: medium; commits: 530468259392; files: src/plugin-sdk/provider-onboard.ts, src/commands/onboard-auth.config-shared.test.ts)
  • RyanLee-Dev: Recent MiniMax model support history touched the same bundled provider onboarding area now covered by the PR's MiniMax regression tests. (role: recent MiniMax contributor; confidence: medium; commits: b64f4e313dab; files: extensions/minimax/onboard.ts, extensions/minimax/onboard.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (7 earlier review cycles)
  • reviewed 2026-07-04T22:55:02.276Z sha 8bb6fd6f432721517a82bb002edbf5caed953541 :: needs real behavior proof before merge. :: [P1] Honor callers that intentionally drop provider auth fields
  • reviewed 2026-07-05T01:11:26.735Z sha 50d87d4c443ae2697459ed19cb2fb0292dab2047 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T15:29:29.673Z sha 50d87d4c443ae2697459ed19cb2fb0292dab2047 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T18:03:33.884Z sha 3214780c57e9b9d3f5e53b6082f01b955ef93d96 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T18:10:42.824Z sha 3214780c57e9b9d3f5e53b6082f01b955ef93d96 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T20:03:29.082Z sha bb931ef39d1e781fd59862acd79b05e4754bda9b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T20:21:28.878Z sha 9544a0d36e42039154a91b14fe062326d1469590 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 4, 2026
@frank-beans
frank-beans force-pushed the codex/preserve-provider-timeouts branch from 8bb6fd6 to 50d87d4 Compare July 4, 2026 22:58
@openclaw-barnacle openclaw-barnacle Bot added extensions: minimax and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 4, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 4, 2026
@harjothkhara

Copy link
Copy Markdown
Contributor

I reviewed current head 50d87d4c443ae2697459ed19cb2fb0292dab2047 after the stale ClawSweeper marker. No blocking source finding from this pass.

Best-fix verdict: this looks like the right narrow owner-boundary fix for the current regression. applyOnboardAuthAgentModelsAndProviders() now merges existing provider config only for the patched provider entry, preserving non-auth provider fields such as timeoutSeconds and untouched providers, while still deleting omitted auth-bearing fields (apiKey, auth, headers) so onboarding paths like MiniMax can intentionally clear stale/placeholder credentials.

Alternatives checked:

  • Replacing models.providers with the patch is the current-main behavior that loses provider-level settings such as timeoutSeconds.
  • Shallow-merging every provider field was the earlier head that could resurrect auth fields intentionally omitted by a provider patch.
  • A narrower named allowlist for only timeoutSeconds would avoid auth risk too, but would unnecessarily drop other non-auth ModelProviderConfig settings (contextWindow, contextTokens, maxTokens, region, params, request, etc.) that provider onboarding refreshes should not erase when the patch does not own them.

Code read: src/plugin-sdk/provider-onboard.ts, src/config/types.models.ts, src/config/provider-policy.ts, extensions/minimax/onboard.ts, extensions/minimax/onboard.test.ts, and src/commands/onboard-auth.config-shared.test.ts.

Focused proof passed locally with the repo Node 24 runtime:

/Users/harjothk/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/run-vitest.mjs src/commands/onboard-auth.config-shared.test.ts extensions/minimax/onboard.test.ts -- --reporter=verbose

Result: 2 Vitest shards passed, 25 tests passed. git diff --check origin/main...HEAD also passed. Remaining uncertainty: I did not run a live OMLX/iMessage onboarding refresh, and a few broad CI shards were still in progress when I checked.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@steipete steipete self-assigned this Jul 5, 2026
@steipete
steipete force-pushed the codex/preserve-provider-timeouts branch from 50d87d4 to 69345b8 Compare July 5, 2026 17:52
@steipete
steipete force-pushed the codex/preserve-provider-timeouts branch 2 times, most recently from bc28f4e to 3214780 Compare July 5, 2026 17:59
@steipete

steipete commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer refresh and deep review are complete on exact head 61cbd904a7afde0be6b826fc209f3e553179d691.

The final shared onboarding writer preserves operator-owned provider settings and untouched providers while deliberately clearing omitted root and nested request authentication fields. Skeptical review also fixed canonical-key precedence, complete duplicate-key collapse, and MiniMax custom-model plus structured-SecretRef retention when repairing legacy provider keys.

Proof:

  • Sanitized public-network AWS Crabbox lease cbx_d1cdf5186b6b, run run_05922d50e8f3: pnpm test src/commands/onboard-auth.config-shared.test.ts extensions/minimax/onboard.test.ts — 29/29 passed.
  • Fresh exact-head Codex autoreview: clean, 0.90 correctness confidence.
  • Targeted formatting and git diff --check: passed.
  • All exact-head hosted workflows green; the unrelated broad QA failure passed on rerun.

This is the owner-aligned fix: the shared writer owns preservation and canonicalization, MiniMax resolves its own model/SecretRef state, and omitted credentials cannot be revived by a shallow merge.

@steipete
steipete force-pushed the codex/preserve-provider-timeouts branch 2 times, most recently from ca6cd7b to 9544a0d Compare July 5, 2026 20:15
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete
steipete force-pushed the codex/preserve-provider-timeouts branch from 9544a0d to 4f2f530 Compare July 5, 2026 20:30
@steipete
steipete force-pushed the codex/preserve-provider-timeouts branch from 4f2f530 to 61cbd90 Compare July 5, 2026 20:36
@steipete
steipete merged commit 664464c into openclaw:main Jul 5, 2026
97 checks passed
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* Preserve provider settings during onboarding updates

* fix(onboarding): clear omitted request auth

* fix(onboarding): retain canonical provider keys

* fix(onboarding): canonicalize provider updates

* fix(minimax): preserve models across provider aliases

* fix(minimax): preserve secret references during onboarding

---------

Co-authored-by: Peter Steinberger <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
* Preserve provider settings during onboarding updates

* fix(onboarding): clear omitted request auth

* fix(onboarding): retain canonical provider keys

* fix(onboarding): canonicalize provider updates

* fix(minimax): preserve models across provider aliases

* fix(minimax): preserve secret references during onboarding

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 664464c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations extensions: minimax merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

3 participants