Skip to content

fix(ui): preserve source config for Control UI saves - #85879

Merged
steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-openclaw-85831
May 24, 2026
Merged

steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-openclaw-85831

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the Control UI config form to use the redacted source/resolved config snapshot for form editing and save serialization.
  • Keep runtime config available on the snapshot for read-only UI surfaces, but do not let runtime defaults such as models.providers.openai.baseUrl: "" leak into config.set.
  • Add a regression test covering a bundled provider overlay with agentRuntime.id and no authored baseUrl.

Fixes #85831.

Credit: reported by @garyd9 in #85831.

Verification

  • node scripts/run-vitest.mjs ui/src/ui/controllers/config.test.ts
  • pnpm check:changed

Real behavior proof

Behavior addressed: Saving Control UI form changes no longer persists runtime-materialized empty provider baseUrl values when the authored config omitted them.
Real environment tested: To be filled by executor after applying the patch.
Exact steps or command run after this patch: node scripts/run-vitest.mjs ui/src/ui/controllers/config.test.ts; pnpm check:changed.
Evidence after fix: Regression test should show config.set raw payload keeps models.providers.openai.agentRuntime.id and omits models.providers.openai.baseUrl when only the runtime snapshot contains baseUrl: "".
Observed result after fix: To be filled by executor after validation.
What was not tested: Manual browser save against a live gateway unless the executor runs an optional Control UI smoke.

ClawSweeper 🐠 replacement reef notes:

  • Cluster: issue-openclaw-openclaw-85831
  • Source PRs: none
  • Credit: Source issue reported by @garyd9: [Bug]: control-ui config saving error ignores schema defaults #85831; Changelog entry may thank @garyd9 because this is a user-facing bug fix from an external reporter.
  • Validation: node scripts/run-vitest.mjs ui/src/ui/controllers/config.test.ts; pnpm check:changed
  • Replacement reason: ClawSweeper could not update the source PR branch directly, so it opened a writable replacement PR instead.

fish notes: model gpt-5.5, reasoning high; reviewed against 289b81d.

Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge.

Latest ClawSweeper review: 2026-05-24 00:44 UTC / May 23, 2026, 8:44 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

PR Surface
Source +15, Tests +59, Docs +1. Total +75 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 35 20 +15
Tests 1 62 3 +59
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 98 23 +75

Summary
The branch updates Control UI config editing to prefer source/resolved snapshots over runtime config, adds ConfigSnapshot fields, adds a provider-overlay regression test, and records the fix in the changelog.

Reproducibility: yes. from source: current main edits and serializes the runtime config snapshot, while validation rejects a runtime-materialized empty provider baseUrl if it is submitted. I did not run a live browser repro in this read-only review.

PR rating
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Summary: Focused bugfix with good source alignment and regression coverage; live UI proof would be useful but is not a contributor gate for this bot PR.

Rank-up moves:

  • none
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.

Real behavior proof
Not applicable: This is a ClawSweeper-generated bot PR, so the external contributor proof gate does not apply; the body still lacks live browser proof.

Mantis proof suggestion
A short Control UI save smoke would directly demonstrate the visible failure is gone. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify Control UI saves an Agents tools toggle when openclaw.json has models.providers.openai.agentRuntime.id but no baseUrl, and no baseUrl is written.

Risk before merge

  • The PR body does not include a live browser save proof against a running gateway; the review evidence is source inspection plus the PR's stated unit and changed-check validation.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused source-snapshot save fix after normal PR checks, and use a small Control UI smoke if maintainers want runtime proof beyond the regression test.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No separate repair lane is needed; this PR is already the active fix candidate and this pass found no blocking code defect.

Security
Cleared: No concrete security or supply-chain concern found; the patch does not add dependencies or execution paths and keeps using the existing redacted config snapshot.

Review details

Best possible solution:

Land the focused source-snapshot save fix after normal PR checks, and use a small Control UI smoke if maintainers want runtime proof beyond the regression test.

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

Yes, from source: current main edits and serializes the runtime config snapshot, while validation rejects a runtime-materialized empty provider baseUrl if it is submitted. I did not run a live browser repro in this read-only review.

Is this the best way to solve the issue?

Yes, the PR uses the gateway's existing source/resolved snapshot contract instead of adding a new config mode or write-side workaround, and it keeps runtime config available for read-only surfaces.

Label changes:

  • add P2: This is a normal-priority user-facing Control UI config-save bugfix with limited blast radius and a clear linked report.
  • add rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🌊 off-meta tidepool, patch quality is 🐚 platinum hermit, and Focused bugfix with good source alignment and regression coverage; live UI proof would be useful but is not a contributor gate for this bot PR.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a ClawSweeper-generated bot PR, so the external contributor proof gate does not apply; the body still lacks live browser proof.

Label justifications:

  • P2: This is a normal-priority user-facing Control UI config-save bugfix with limited blast radius and a clear linked report.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🌊 off-meta tidepool, patch quality is 🐚 platinum hermit, and Focused bugfix with good source alignment and regression coverage; live UI proof would be useful but is not a contributor gate for this bot PR.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a ClawSweeper-generated bot PR, so the external contributor proof gate does not apply; the body still lacks live browser proof.

What I checked:

  • Current UI save path uses runtime config: Current main builds the clean form/original state from snapshot.config, and later form mutations also fall back to state.configSnapshot?.config, which is the runtime-shaped snapshot that can contain materialized provider defaults. (ui/src/ui/controllers/config.ts:119, acf265d4d51d)
  • Gateway snapshot contract separates source and runtime config: ConfigFileSnapshot documents sourceConfig/resolved as pre-runtime-default config for writes, while runtimeConfig/config are runtime-shaped config. (src/config/types.openclaw.ts:187, acf265d4d51d)
  • config.get exposes redacted source/resolved aliases: redactConfigSnapshot returns redacted sourceConfig and resolved alongside runtime config, so the UI already has a safe source snapshot to edit. (src/config/redact-snapshot.ts:463, acf265d4d51d)
  • Validation explains the reported failure mode: Model provider baseUrl is optional but, when present, must be non-empty; bundled provider overlays are only materialized with baseUrl: "" after schema parsing, so submitting runtime materialization can fail where omitting it succeeds. (src/config/zod-schema.core.ts:453, acf265d4d51d)
  • PR uses editable source/resolved snapshot: The patch adds resolveEditableSnapshotConfig and rewires clean snapshot application, dirty-state comparison, form mutation, presets, and agent helpers to prefer sourceConfig/resolved before falling back to runtime config. (ui/src/ui/controllers/config.ts:97, 289b81df506a)
  • PR regression covers the linked provider-overlay bug: The new test applies a snapshot where runtime config has models.providers.openai.baseUrl: "" but sourceConfig omits it, edits UI theme, saves, and asserts the submitted config.set payload preserves agentRuntime.id while omitting baseUrl. (ui/src/ui/controllers/config.test.ts:842, 289b81df506a)

Likely related people:

  • Peter Steinberger: Current blame for the Control UI config controller and type surface points to commit a705a9c, and recent log/search history also shows related sourceConfig/redaction work in this area. (role: recent area contributor; confidence: high; commits: a705a9c911bc, 86734ef93a; files: ui/src/ui/controllers/config.ts, ui/src/ui/types.ts, src/config/redact-snapshot.ts)
  • Maude Bot: git log -S'configFormOriginal' shows the earlier Control UI config page overhaul that introduced the form/original state pattern this PR now adjusts. (role: earlier feature contributor; confidence: medium; commits: 929d50b7d155; files: ui/src/ui/controllers/config.ts)
  • Abdel Sy Fane: History search ties the gateway config.get credential-redaction surface to commit 0c7fa2b, which is adjacent to the source/runtime snapshot contract used by this fix. (role: config redaction contributor; confidence: medium; commits: 0c7fa2b0d539; files: src/config/redact-snapshot.ts, src/gateway/server-methods/config.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against acf265d4d51d.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper PR egg

✨ Hatched: 🥚 common Pearl Signal Puff

Hatched PR egg: 🥚 common Pearl Signal Puff

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: sparkles near resolved comments.
Image traits: location flaky test forest; accessory green check lantern; palette seafoam, black, and opal; mood watchful; pose curling around a status light; shell woven fiber shell; lighting calm overcast light; background tiny shells and proof notes.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Pearl Signal Puff in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper hatch

@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🦞👀
ClawSweeper PR egg hatch requested.

I queued a comment sync for this PR. If the egg is hatchable, ClawSweeper will generate the image once and update the existing review comment.
Action: PR egg hatch queued (workflow sweep.yml, event repository_dispatch).
The ASCII egg stays as the fallback.

@steipete
steipete merged commit 1a60c19 into main May 24, 2026
124 of 135 checks passed
@steipete
steipete deleted the clawsweeper/issue-openclaw-openclaw-85831 branch May 24, 2026 01:23
@steipete

Copy link
Copy Markdown
Contributor

Landed. Proof before merge: focused Control UI config controller regression test, autoreview clean, and live CI green.

Merge commit: 1a60c19

Thanks @garyd9 for the report.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper Tracked by ClawSweeper automation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[Bug]: control-ui config saving error ignores schema defaults

2 participants