Repository navigation
fix: preserve provider defaults during config saves - #85903
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-24 03:06 UTC / May 23, 2026, 11:06 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: yes. for the gateway-level case from source: current main validates config.set payloads against baseUrl minLength while runtime snapshots can contain baseUrl: "". The original Control UI user path is already covered by current-main UI sourceConfig submission. PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Maintain one canonical fix: rebase and land the gateway-side hardening only if server API compatibility for runtime-shaped config payloads is desired; otherwise close it as superseded by the current UI sourceConfig fix. Do we have a high-confidence way to reproduce the issue? Yes for the gateway-level case from source: current main validates config.set payloads against baseUrl minLength while runtime snapshots can contain baseUrl: "". The original Control UI user path is already covered by current-main UI sourceConfig submission. Is this the best way to solve the issue? Unclear: the PR is a narrow gateway hardening and its test matches the RPC path, but current main already solves the reported Control UI save failure. Maintainers should decide whether the server should also accept runtime-shaped default-only fields. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 841cb121fb70. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec2dccb755
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| : restored.result; | ||
| const validationCandidate = stripBundledProviderRuntimeDefaults({ | ||
| candidate: projectedValidationCandidate, | ||
| sourceConfig: snapshot.parsed, |
There was a problem hiding this comment.
Check authored provider keys against resolved source config
The default-stripping step is using snapshot.parsed as the authored-source reference, but parsed is the root file before $include expansion. For configs that define models.providers in an included file, this makes stripBundledProviderRuntimeDefaults treat included provider fields as "not authored" and remove built-in models: [] entries during config.set/config.apply. That can create unintended diffs under include-owned paths and cause unrelated saves to fail with include-flattening write guards; the source-of-truth for authored-key presence here should be the resolved source snapshot instead.
Useful? React with 👍 / 👎.
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Gilded Test Hopper Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
ec2dccb to
29f5a89
Compare
Summary
Verification
pnpm exec oxfmt --write --threads=1 src/gateway/server-methods/config.ts src/gateway/server.config-patch.test.ts && git diff --checknode scripts/run-vitest.mjs src/gateway/server.config-patch.test.tspnpm check:changedvia Testboxtbx_01ksbz9jcz62vp9zgpa3m71cw9, GitHub Actions run https://github.com/openclaw/openclaw/actions/runs/26350430946autoreview --mode branch --base origin/main --engine codex --model gpt-5.3-codex-spark --no-web-search: clean, no accepted/actionable findingsBehavior addressed: Gateway full-config writes now tolerate runtime-shaped bundled provider defaults, complementing the Control UI source-snapshot fix already merged in #85879.
Real environment tested: Local OpenClaw checkout plus Blacksmith Testbox changed gate.
Exact steps or command run after this patch: Wrote a source config with models.providers.openai.agentRuntime.id, loaded it through config.get, submitted the runtime-shaped config through config.set with baseUrl empty, and verified the save succeeds.
Evidence after fix: Added regression in src/gateway/server.config-patch.test.ts; focused test passed 23/23 and check:changed passed on Testbox.
Observed result after fix: config.set returns ok and persisted config contains the unrelated gateway port edit without persisting default-only baseUrl.
What was not tested: Live browser Control UI manual save; #85879 covers the UI submit path and this patch covers the gateway RPC path directly.
Refs #85831.