Skip to content

feat(ui): Labs settings page for experimental feature toggles - #110359

Merged
steipete merged 5 commits into
mainfrom
feat/labs-page-0717
Jul 18, 2026
Merged

steipete merged 5 commits into
mainfrom
feat/labs-page-0717

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Experimental features (Code Mode today, Swarm next) are enabled only by hand-editing openclaw.json. There is no discoverable, safe place in the Control UI to try them.

Why This Change Was Made

Part of the Swarm program (#110325): a Settings → Labs page gives experimental features one obvious home with clear "may change or break" framing, so gated features can ship dark on main and be flipped on deliberately.

User Impact

New Settings → Labs page (Agents & Tools group). First entry: Code Mode — toggle reads both accepted config shapes (tools.codeMode: true boolean shorthand and object form) and writes an RFC 7396 merge-patch with an explicit false on disable (never a key delete). Registry-driven so future entries (Swarm, #110325) are one-liners; a Swarm entry is stubbed but not rendered until its config key exists in the schema.

Labs settings page

Evidence

  • Focused vitest: ui/src/pages/labs/labs-page.test.ts + navigation tests — 58 passed (see checks).
  • Fresh autoreview (codex gpt-5.6-sol, branch mode): clean, 0 findings, "patch is correct (0.94)".
  • Live render verified against pnpm dev:ui:mock (screenshot above; toggle interaction is config-snapshot-gated, covered by unit tests for merge-patch correctness).
  • i18n: en keys authored; foreign-locale sync follows the normal post-merge workflow.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1348b0e453

ℹ️ 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".

Comment on lines +84 to +86
if (!patched) {
this.saveError = runtimeConfig.state.lastError ?? t("labsPage.saveFailed");
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh stale Labs config after hash conflicts

When config.patch returns false because the on-disk config changed after Labs loaded, this branch records the error but leaves runtimeConfig.state.configSnapshot and its base hash unchanged. In that stale-config scenario, every subsequent toggle retries with the same rejected hash and keeps failing until the user leaves/reloads the page; this scalar toggle should refresh and retry, or at least refresh before returning the error.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 3:14 PM ET / 19:14 UTC.

Summary
Adds a Settings → Labs Control UI page with a registry-backed Code Mode toggle, navigation and route wiring, English/Apple localization, and focused UI tests.

PR surface: Source +269, Tests +141, Other +104. Total +514 across 11 files.

Reproducibility: no. high-confidence live reproduction was established here. Source and the prior review identify a clear rejected-hash path, but it still needs confirmation against a real Gateway-backed runtime configuration write.

Review metrics: 1 noteworthy metric.

  • Persisted feature controls: 1 added. The PR adds one Control UI toggle that writes the existing Code Mode configuration, making write-conflict and upgrade behavior merge-relevant.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • Refresh the runtime configuration snapshot after a rejected patch.
  • Post redacted Gateway-backed evidence covering enable, explicit disable, and a rejected-hash recovery.
  • After updating the PR body, request a fresh review with @clawsweeper re-review if one is not triggered automatically.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The screenshot proves a mock-mode render, not the real Gateway-backed configuration write, explicit false disable, or rejected-hash recovery; add redacted live UI, terminal, or runtime-log proof and update the PR body for a fresh review.

Risk before merge

  • [P1] Merging without refreshing the runtime snapshot after a rejected patch can leave users unable to change the toggle until they reload or leave the page.
  • [P1] This new Control UI path writes persisted Code Mode configuration, so real Gateway-backed enable, explicit disable, and conflict behavior need upgrade-safe proof before merge.

Maintainer options:

  1. Repair conflict recovery and prove the real flow (recommended)
    Refresh the runtime configuration snapshot after a rejected patch, then post redacted Gateway-backed evidence for enable, disable, and rejected-hash recovery.
  2. Pause for Labs product direction
    Keep this PR open without merging until maintainers confirm that experimental configuration belongs in a persistent Control UI Labs page.

Next step before merge

  • [P1] The stale-snapshot repair is mechanically clear, but the protected maintainer label and unresolved Labs product direction require human review before any automated repair or merge path.

Maintainer decision needed

  • Question: Should OpenClaw adopt a permanent registry-backed Labs settings page as the Control UI boundary for experimental feature gates?
  • Rationale: This PR adds a new discoverability and configuration-control surface beyond repairing an established UI contract, and the linked Swarm program remains open for maintainer product calibration.
  • Likely owner: steipete — The PR and the linked Swarm proposal identify this person as the active proposer for the Labs direction.
  • Options:
    • Sponsor the Labs boundary (recommended): Approve the Labs page direction, then require the stale-snapshot repair and real Gateway-backed proof before merge.
    • Keep experimental gates configuration-only: Decline this new UI surface and retain the existing documented configuration workflow until a broader Labs product plan is accepted.

Security
Cleared: The reviewed PR surface is UI routing, localization, and an existing configuration write path; no concrete security or supply-chain regression is indicated.

Review findings

  • [P2] Refresh the config snapshot after a rejected patch — ui/src/pages/labs/labs-page.ts:74
Review details

Best possible solution:

Keep a small Labs registry if maintainers want this product surface, but refresh the authoritative config snapshot after a rejected write and attach redacted real Gateway evidence for enable, explicit disable, and conflict recovery before merge.

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

No high-confidence live reproduction was established here. Source and the prior review identify a clear rejected-hash path, but it still needs confirmation against a real Gateway-backed runtime configuration write.

Is this the best way to solve the issue?

No. The Labs page may be a sound long-term UI boundary, but the current patch must refresh after a rejected config patch and demonstrate the real write path before it is the best mergeable solution.

Full review comments:

  • [P2] Refresh the config snapshot after a rejected patch — ui/src/pages/labs/labs-page.ts:74
    When the configuration patch is rejected because its base hash is stale, the page records an error but leaves the old snapshot and hash active. Every later toggle retries the same rejected hash until the user reloads; refresh the authoritative snapshot before returning the error.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is an experimental UI feature proposal rather than an urgent regression.
  • merge-risk: 🚨 compatibility: The new Labs page writes a persisted feature-gate setting and must preserve correct configuration conflict behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The screenshot proves a mock-mode render, not the real Gateway-backed configuration write, explicit false disable, or rejected-hash recovery; add redacted live UI, terminal, or runtime-log proof and update the PR body for a fresh review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The screenshot proves a mock-mode render, not the real Gateway-backed configuration write, explicit false disable, or rejected-hash recovery; add redacted live UI, terminal, or runtime-log proof and update the PR body for a fresh review.
Evidence reviewed

PR surface:

Source +269, Tests +141, Other +104. Total +514 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 269 0 +269
Tests 2 141 0 +141
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 136 32 +104
Total 11 546 32 +514

What I checked:

  • Prior blocker remains on the active implementation: The latest completed ClawSweeper review at 2bb2773e39b42e1ed3ab7681720d3ca41b7369b6 identified that a rejected hash leaves the runtime config snapshot stale, causing subsequent toggles to reuse the rejected base hash; the current head’s only subsequent commit is a Labs registry comment clarification, not a repair to the page write path. (ui/src/pages/labs/labs-page.ts:1, 44471089ec1a)
  • Configuration-write surface: The PR’s Labs registry maps Code Mode to tools.codeMode.enabled, while the page reads a runtime snapshot and submits a merge patch; this makes rejected-hash recovery part of the user-visible toggle contract. (ui/src/pages/labs/labs-registry.ts:16, 44471089ec1a)
  • Real-behavior evidence is incomplete: The PR body provides a screenshot from pnpm dev:ui:mock and focused tests, but it does not show a real Gateway-backed enable, explicit disable, or conflict/reload result. (ui/src/pages/labs/labs-page.test.ts:1, 44471089ec1a)
  • Related direction remains open: The Labs-page proposal is partially connected to the open Swarm direction, but this PR independently exposes Code Mode and does not replace the remaining Swarm product decision. (ui/src/pages/labs/labs-registry.ts:23, 44471089ec1a)

Likely related people:

  • steipete: The provided PR and linked Swarm proposal both attribute the Labs/experimental-feature direction to this person; current-main ownership history was not available in the read-only execution environment. (role: feature proposer and recent area contributor; confidence: low; commits: 51d9d033f26e, 44471089ec1a; files: ui/src/pages/labs/labs-page.ts, ui/src/pages/labs/labs-registry.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 (3 earlier review cycles)
  • reviewed 2026-07-18T03:59:54.337Z sha 1348b0e :: needs real behavior proof before merge. :: [P2] Refresh the config snapshot after a rejected patch
  • reviewed 2026-07-18T09:07:14.291Z sha 28f7dc4 :: needs real behavior proof before merge. :: [P2] Refresh the config snapshot after a rejected patch
  • reviewed 2026-07-18T18:45:03.358Z sha 2bb2773 :: needs real behavior proof before merge. :: [P2] Refresh the config snapshot after a rejected patch

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: L and removed size: M labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 18, 2026
@steipete steipete closed this Jul 18, 2026
@steipete steipete reopened this Jul 18, 2026
@steipete
steipete force-pushed the feat/labs-page-0717 branch from 4447108 to d11837e Compare July 18, 2026 20:02
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed app: ios App: ios size: L labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d11837e02c

ℹ️ 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".

Comment on lines +58 to +61
configState?.connected &&
configState.configSnapshot?.hash &&
!configState.configLoading &&
this.busyFeatureId === null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable toggles for non-admin operators

When the Control UI is connected with only operator.read, config.get still supplies a snapshot and hash, so this predicate enables the switch; clicking it then calls config.patch, which requires operator.admin (src/gateway/methods/core-descriptors.ts:51), causing the switch to revert with a save error. Include the Gateway auth scope in this gate (and react to Gateway snapshot changes) so read-only operators are not offered a control they cannot use.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit ef7f4f2 into main Jul 18, 2026
103 of 106 checks passed
@steipete
steipete deleted the feat/labs-page-0717 branch July 18, 2026 20:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 19, 2026
…aw#110359)

* feat(ui): add Labs settings page

* chore(ui): drop changelog entry — release generation owns CHANGELOG

* fix(ui): drop lint suppression, sync Apple i18n catalogs for Labs keys

* ci: retrigger CI on current head

* docs(ui): clarify swarm labs-entry gating comment
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…aw#110359)

* feat(ui): add Labs settings page

* chore(ui): drop changelog entry — release generation owns CHANGELOG

* fix(ui): drop lint suppression, sync Apple i18n catalogs for Labs keys

* ci: retrigger CI on current head

* docs(ui): clarify swarm labs-entry gating comment
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 maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant