Skip to content

fix(control-ui): keep raw mode for editable config snapshots#86640

Closed
BlackFrameAI wants to merge 1 commit into
openclaw:mainfrom
BlackFrameAI:codex/control-ui-raw-mode-editable-config
Closed

fix(control-ui): keep raw mode for editable config snapshots#86640
BlackFrameAI wants to merge 1 commit into
openclaw:mainfrom
BlackFrameAI:codex/control-ui-raw-mode-editable-config

Conversation

@BlackFrameAI

@BlackFrameAI BlackFrameAI commented May 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Keeps the Control UI raw config mode available when a config snapshot has editable structured config but no raw text payload.
  • Uses the same raw availability rule in both the renderer props and config controller state transition.
  • Updates the config controller test so snapshots with serializable config stay in raw mode instead of being forced back to form mode.

Why

The gateway can return snapshots where raw is missing or null while structured config is still available through sourceConfig, resolved, or config. The controller already serializes that editable config into configRaw, so treating raw mode as unavailable solely because snapshot.raw is absent hides a mode that can still be rendered from structured config.

This fixes the UI/control-state mismatch without changing behavior for snapshots that truly have neither raw text nor editable structured config.

Real behavior proof

  • Behavior or issue addressed: The live Control UI keeps Raw config mode available when the gateway snapshot has editable structured config but no raw string.
  • Real environment tested: WSL Ubuntu 24.04 local OpenClaw setup, OpenClaw 2026.5.25, token-authenticated Control UI at http://127.0.0.1:18789/config, backed by running OpenClaw gateway processes from /home/icon/CodexOps/OpenClaw/dist/index.js.
  • Exact steps or command run after this patch: Loaded the token-authenticated Control UI in headless Chrome, opened Settings -> Advanced, selected Raw, and inspected the live openclaw-app state plus the rendered tab buttons.
  • Evidence after fix:
title=OpenClaw Control
url=http://127.0.0.1:18789/config
containsConfig=true
live state: snapshotRawIsString=false, snapshotRawType=object, hasSourceConfig=true, hasConfig=true, generatedRawLength=25322
rendered buttons: Form disabled=false, Raw disabled=false, Save disabled=true, Apply disabled=true
  • Observed result after fix: Raw mode was selectable on the live Settings page even though the snapshot did not contain raw text; the UI used generated raw text from the editable config instead of forcing the user back to Form mode.
  • What was not tested: The generated-raw Save submit path is covered separately in fix(control-ui): save generated raw config text #86641.

Validation

  • pnpm --dir ui test src/ui/controllers/config.test.ts

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed May 25, 2026, 9:01 PM ET / 01:01 UTC.

Summary
The PR widens Control UI Raw config mode availability for snapshots with editable structured config but no raw text, and updates the controller regression test for that state.

PR surface: Source +3, Tests 0. Total +3 across 3 files.

Reproducibility: yes. source inspection gives a high-confidence path: apply a raw:null snapshot with sourceConfig and the PR keeps Raw mode available, but save/apply still reaches the current raw-absent guard. I did not execute tests because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Raw-mode gates: 2 widened, 1 submit guard unchanged. The controller and renderer now make Raw mode reachable for generated config, while save/apply still reject snapshots without raw text.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

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

Rank-up moves:

  • Remove state.configForm from raw availability and test the no-raw/no-editable-config snapshot path.
  • Bring the generated-raw save/apply predicate into this PR or land it atomically with the companion PR.
  • Run the focused controller and config browser tests after the repair.

Mantis proof suggestion
A short browser proof would be useful after the repair because the changed behavior is visible in the Control UI Raw/Form toggle. 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 Settings keeps Raw available for raw:null snapshots with sourceConfig and disables Raw when no editable config exists.

Risk before merge

  • Merging this PR by itself can expose Raw mode for snapshots that have neither raw text nor editable structured config because state.configForm can be truthy from an empty or previous form state.
  • Merging this PR without fix(control-ui): save generated raw config text #86641 or an equivalent submit-path change lets users enter Raw mode for generated config but then hit the existing Save/Apply rejection.

Maintainer options:

  1. Repair the raw-mode contract before merge (recommended)
    Update the PR so availability and save/apply eligibility share the same generated-raw predicate, and add regressions for editable and non-editable no-raw snapshots.
  2. Land only as a coordinated stack
    If maintainers keep this split, merge the companion submit fix at fix(control-ui): save generated raw config text #86641 in the same landing window so users do not receive selectable Raw mode with rejected saves.
  3. Pause the split PR
    Pause or close this branch if the companion PR is the better place to carry the full generated-raw behavior end to end.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Update this PR so Control UI raw availability is based only on current snapshot raw text or serializable editable snapshot config, not stale state.configForm; align save/apply eligibility for generated configRaw or keep Raw disabled until it can submit; add controller and render regressions for both editable raw:null snapshots and snapshots with no raw/sourceConfig/resolved/config.

Next step before merge
The remaining blockers are concrete code/test repairs in the same Control UI config path and do not require a product decision.

Security
Cleared: No concrete security or supply-chain concern was found in this small Control UI state/test change; the remaining issues are functional config-editing correctness.

Review findings

  • [P2] Do not use stale form state for raw availability — ui/src/ui/controllers/config.ts:116
  • [P2] Keep generated-raw saves enabled with the mode — ui/src/ui/app-render.ts:1201
Review details

Best possible solution:

Land one coherent raw-mode contract: availability should depend on current snapshot raw text or current serializable editable snapshot config, and generated raw drafts should save/apply with regression coverage for both editable and non-editable no-raw snapshots.

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

Yes, source inspection gives a high-confidence path: apply a raw:null snapshot with sourceConfig and the PR keeps Raw mode available, but save/apply still reaches the current raw-absent guard. I did not execute tests because this review is read-only.

Is this the best way to solve the issue?

No, not as submitted. The direction is narrow and maintainable, but the implementation should use current snapshot editability instead of state.configForm truthiness and should include or coordinate the generated-raw submit fix.

Full review comments:

  • [P2] Do not use stale form state for raw availability — ui/src/ui/controllers/config.ts:116
    With this branch, rawAvailable becomes true whenever state.configForm is truthy. applyConfigSnapshot sets configForm to {} on clean snapshots even when there is no sourceConfig, resolved, or config, and before that it can still hold the previous snapshot's form. That makes Raw selectable for the exact no-raw/no-editable-config case the PR says should stay disabled, potentially showing stale raw text; base this predicate on the current snapshot's editable config instead and add that regression.
    Confidence: 0.91
  • [P2] Keep generated-raw saves enabled with the mode — ui/src/ui/app-render.ts:1201
    After this branch leaves configFormMode as raw for raw: null snapshots with editable config, any user edit makes Save/Apply call serializeFormForSubmit, which still throws when snapshot.raw is not a string. Include the submit-path fix from fix(control-ui): save generated raw config text #86641 in this stack, or keep Raw disabled until generated configRaw can submit.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live Control UI output showing a token-authenticated Settings page where a raw:null snapshot with structured config left the Raw button enabled after the patch.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body includes copied live Control UI output showing a token-authenticated Settings page where a raw:null snapshot with structured config left the Raw button enabled after the patch.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a normal-priority Control UI config editing bug with a clear, limited blast radius but a blocking merge defect.
  • merge-risk: 🚨 compatibility: The PR changes config editing mode availability and can make an existing Control UI config workflow fail at save/apply time after upgrade.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body includes copied live Control UI output showing a token-authenticated Settings page where a raw:null snapshot with structured config left the Raw button enabled after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live Control UI output showing a token-authenticated Settings page where a raw:null snapshot with structured config left the Raw button enabled after the patch.
Evidence reviewed

PR surface:

Source +3, Tests 0. Total +3 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 5 2 +3
Tests 1 2 2 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 7 4 +3

Acceptance criteria:

  • node scripts/run-vitest.mjs ui/src/ui/controllers/config.test.ts
  • node scripts/run-vitest.mjs ui/src/ui/views/config.browser.test.ts

What I checked:

Likely related people:

  • joshavant: Authored the Control UI config raw/SecretRef round-trip hardening that touched the same controller, renderer, view, and tests. (role: recent area contributor; confidence: high; commits: 81b777c7687d, 786823fd7054; files: ui/src/ui/controllers/config.ts, ui/src/ui/views/config.ts, ui/src/ui/app-render.ts)
  • UB: Current blame for the raw availability and submit guard lines in this checkout points to this recent commit, though the commit title is broad and the ownership signal is mostly line-level. (role: recent line owner; confidence: medium; commits: 48adcb162c92; files: ui/src/ui/controllers/config.ts, ui/src/ui/app-render.ts, ui/src/ui/controllers/config.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.

@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. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress.

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

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 26, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels May 26, 2026
@BlackFrameAI

Copy link
Copy Markdown
Contributor Author

Closing this split PR as superseded by #86700. Raw-mode availability and generated-raw submit behavior are coupled, so they are now combined in one replacement PR.

@BlackFrameAI BlackFrameAI deleted the codex/control-ui-raw-mode-editable-config branch May 26, 2026 01:12
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 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. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant