Skip to content

fix(ui): persist per-agent settings changes - #117107

Merged
vincentkoc merged 1 commit into
mainfrom
fix/control-ui-agent-config
Jul 31, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/control-ui-agent-config

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Closes #117046

What Problem This Solves

Fixes an issue where users changing per-agent model, tool, skill, or device settings in the Control UI could save to a retired configuration path, so the intended setting would not persist. Save failures could also be obscured by an immediate roster refresh.

Why This Change Was Made

All affected Control UI paths now resolve one canonical agents.entries target through the shared runtime-config capability. The resolver preserves authored agent keys, rejects unsafe keys, and is shared by Agents and Nodes; adjacent cron and swarm readers now consume the same canonical shape. Failed saves remain dirty and render the Gateway error in the active panel.

User Impact

Per-agent settings now persist through the current Gateway schema, and validation failures are visible instead of looking like successful saves.

Evidence

  • Exact changed gate: node scripts/check-changed.mjs on Blacksmith Testbox, coreTests + ui, exit 0 (run).
  • Focused Control UI tests: 314 tests across the affected config, agent, cron, swarm, and node modules.
  • Playwright browser proof: 11 scenarios across six files, including the new Gateway-backed config save/error flow.
  • Gateway config patch suite: 42 tests passed.
  • Final autoreview: no findings; secret scan clean.
{
  "scenario": "agent tools config save",
  "changedPath": "settings/agents/main/tools",
  "gateway": "mock",
  "provider": "mock",
  "result": "pass",
  "evidence": "config.set raw used agents.entries.main.tools, omitted agents.list, preserved baseHash, and surfaced INVALID_REQUEST"
}

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@vincentkoc vincentkoc self-assigned this Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 31, 2026
@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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 7:46 PM ET / 23:46 UTC.

ClawSweeper review

What this changes

The branch changes Control UI per-agent model, tools, skills, and node-binding configuration writes from legacy array paths to canonical keyed agents.entries, and displays Gateway save errors in the active agent panel.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal maintainer review: current main still constructs per-agent UI mutations through the retired agents.list array, while the branch centralizes keyed agents.entries resolution, preserves authored keys, and stops a failed save from being immediately masked by a roster refresh. I found no concrete correctness defect in the inspected patch; the author is a repository member and the PR carries the protected maintainer label, so cleanup automation should not close or dispatch it.

Priority: P1
Reviewed head: 163b5b8e358d381496bcf7c6a2fcf0380fc42c02

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent shared owner boundary, targeted regression coverage, and no concrete defect found in the inspected source; remaining merge gating is normal exact-head CI and maintainer review.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports focused mocked-Gateway browser coverage and exact changed-gate evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports focused mocked-Gateway browser coverage and exact changed-gate evidence.
Evidence reviewed 6 items Current-main defect path: The checked-out current-main parent still exposes findAgentConfigEntryIndex and ensureAgentEntry, both of which read or create agents.list array paths; the agent model editor also reads and writes agents.list[index].model. This substantiates the reported failure mechanism before the proposed repair.
Gateway contract: The agent configuration schema is strict and accepts keyed agents.entries records with exactly one default entry, while the Gateway config.set handler parses and validates the submitted raw document before committing it. A legacy agents.list member is therefore rejected rather than ignored.
Branch repair owner boundary: The PR introduces a shared keyed-entry resolver that normalizes agent ids, preserves an authored matching key, rejects prototype-sensitive keys, and returns the canonical agents.entries target. Agent and Node callers route their mutations through this capability instead of maintaining separate array-index policy.
Findings None None.
Security None None.

How this fits together

The Control UI loads the Gateway configuration snapshot, stages edits in a form draft, and sends the whole serialized draft through config.set. Agent, node, cron, swarm, and display surfaces consume that draft, so they must agree on the canonical keyed agent-entry shape before Gateway validation and persistence.

flowchart LR
  A[Gateway config snapshot] --> B[Control UI runtime config draft]
  B --> C[Keyed agent entry resolver]
  C --> D[Agent settings and model panels]
  C --> E[Node binding and sibling readers]
  D --> F[Gateway config.set validation]
  E --> F
  F --> G[Persisted configuration or visible save error]
Loading

Before merge

  • Resolve merge risk (P1) - The full merge-result CI matrix is still running; maintainers should land only the exact reviewed head after the remaining required checks complete.
Agent review details

Security

None.

PR surface

Source +3, Tests +409. Total +412 across 29 files.

View PR surface stats
Area Files Added Removed Net
Source 12 156 153 +3
Tests 17 468 59 +409
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 29 624 212 +412

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/agents-set-default-persistence.e2e.test.ts, serialized state: ui/src/lib/sessions/swarm-roster.test.ts, serialized state: ui/src/lib/sessions/swarm-roster.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #117046
Summary: This PR is the concrete candidate repair for the reported Control UI legacy-array serialization failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the shared keyed-entry resolver and its Agent/Node callers once the exact-head checks complete, retaining the explicit active-panel error path and the regression coverage for canonical config.set serialization.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the shared keyed-entry resolver and its Agent/Node callers once the exact-head checks complete, retaining the explicit active-panel error path and the regression coverage for canonical config.set serialization.

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

Yes—source establishes a direct current-main path: Agent settings stage mutations under agents.list, then the whole draft is sent to strict Gateway config.set validation that accepts canonical agents.entries instead. The supplied PR also adds a focused browser-Gateway regression scenario for that path.

Is this the best way to solve the issue?

Yes—the shared runtime-config resolver is the best repair boundary because Agents and Nodes otherwise duplicate array-index lookup and mutation policy. Updating only the Tools panel or only rendering an error would leave sibling configuration paths on the retired shape.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The existing Control UI path can silently prevent users from saving per-agent tool, model, skill, or device settings, affecting an active core workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports focused mocked-Gateway browser coverage and exact changed-gate evidence.

Evidence

What I checked:

  • Current-main defect path: The checked-out current-main parent still exposes findAgentConfigEntryIndex and ensureAgentEntry, both of which read or create agents.list array paths; the agent model editor also reads and writes agents.list[index].model. This substantiates the reported failure mechanism before the proposed repair. (ui/src/lib/config/index.ts:1136, f94a790df599)
  • Gateway contract: The agent configuration schema is strict and accepts keyed agents.entries records with exactly one default entry, while the Gateway config.set handler parses and validates the submitted raw document before committing it. A legacy agents.list member is therefore rejected rather than ignored. (src/config/zod-schema.agents.ts:28, f94a790df599)
  • Branch repair owner boundary: The PR introduces a shared keyed-entry resolver that normalizes agent ids, preserves an authored matching key, rejects prototype-sensitive keys, and returns the canonical agents.entries target. Agent and Node callers route their mutations through this capability instead of maintaining separate array-index policy. (ui/src/lib/config/index.ts:1159, 163b5b8e358d)
  • Failure visibility lifecycle: The branch makes saveAgentConfig stop before roster refresh when runtimeConfig.save() fails and passes Gateway error state to the active agent panel, matching the reported silent-failure symptom rather than compensating downstream. (ui/src/pages/agents/agents-page.ts:793, 163b5b8e358d)
  • Regression coverage: The branch’s focused runtime-config test asserts the serialized config.set payload uses agents.entries and explicitly lacks list; the added browser E2E targets the submitted path and visible validation failure. (ui/src/lib/config/index.test.ts:340, 163b5b8e358d)
  • Current-main and provenance check: The declared current-main SHA is one commit after the checked-out parent and changes only Discord model-picker files plus a line baseline; it does not contain this PR head. The PR therefore remains necessary and is not implemented on main or in the supplied latest release. (01cd336a635e)

Likely related people:

  • Vincent Koc: The branch is the canonical repair linked from the source issue, and prior merged repository history shows repeated maintenance work across core, plugins, CI, and refactors. (role: recent area contributor and PR author; confidence: high; commits: 163b5b8e358d, 61fb29e90a59, a26f6c8374c3; files: ui/src/lib/config/index.ts, ui/src/pages/agents/agents-page.ts, ui/src/pages/nodes/nodes-page.ts)
  • Peter Steinberger: Available UI history includes major Control UI settings and lifecycle work, and the declared current-main commit is authored by Peter Steinberger; the current-main delta is adjacent but not a competing fix. (role: recent Control UI architecture contributor; confidence: medium; commits: 9269a27f18c3, 0a85a65829c, 01cd336a635e; files: ui/src/pages/agents/agents-page.ts, ui/src/lib/config/index.ts)
  • xingzhou: The shallow checkout attributes the currently inspected legacy resolver lines to this commit, although deeper historical attribution is limited by the partial clone. (role: current checked-out source provenance; confidence: low; commits: 2614251533b6; files: ui/src/lib/config/index.ts, ui/src/pages/agents/agents-page.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the remaining exact-head CI matrix, then review the final merge result before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (1 earlier review cycle)
  • reviewed 2026-07-31T23:32:53.373Z sha 163b5b8 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper before-merge disposition for reviewed head 163b5b8e358d381496bcf7c6a2fcf0380fc42c02:

  • Current-main merge risk: refreshed against origin/main at 83e0be6efee6cde3a4f450817858d4245e552204. git merge-tree --write-tree HEAD origin/main completed without conflicts and produced tree 6b28920dd20d43aacea7104ed4e5a889b2491536.
  • Overlapping files reviewed: ui/src/lib/agents/index.test.ts only combines additive reconnect lifecycle tests with the keyed config fixtures. ui/src/pages/nodes/nodes-page.ts combines the new Gateway connection lifecycle with the canonical runtimeConfig.agentEntry(...) binding path; the virtual merge preserves both invariants.
  • Stored-data metric: no persisted-store schema or migration changes are present. The serialized-state matches are tests and readers moving from the already-retired agents.list shape to the already-canonical agents.entries config contract.
  • Repair ownership: this maintainer PR is the canonical repair for [Bug]: Control UI sends legacy agents.list array on config.set, so per-agent Tools panel saves always fail silently #117046; no separate ClawSweeper repair lane is needed.

The draft can move to ready-for-review so GitHub runs the full exact merge-result CI. No merge is authorized in this workstream.

@vincentkoc
vincentkoc marked this pull request as ready for review July 31, 2026 23:40
@vincentkoc
vincentkoc merged commit ee9a658 into main Jul 31, 2026
144 of 151 checks passed
@vincentkoc
vincentkoc deleted the fix/control-ui-agent-config branch July 31, 2026 23:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
Closes openclaw#117046

Per-agent model, tool, skill, and node-binding edits in the Control UI were written to the retired `agents.list` shape, so the strict Gateway schema rejected them. Save failures could then be hidden by an immediate roster refresh.

Route all affected writers through the canonical keyed `agents.entries` resolver, preserve authored keys, reject unsafe keys, align adjacent cron and swarm readers, and keep failed saves dirty with the Gateway error visible in the active panel.

Validated with the exact Testbox changed gate, full CI, 314 focused UI tests, 11 Playwright scenarios, 42 Gateway config tests, clean autoreview, and ClawSweeper review.
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 P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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 sends legacy agents.list array on config.set, so per-agent Tools panel saves always fail silently

1 participant