Skip to content

fix(ui): preserve provider mutation ownership and visible outcomes - #116829

Merged
steipete merged 1 commit into
mainfrom
codex/qa100-model-provider-mutation-owner
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa100-model-provider-mutation-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Give Model Provider settings one canonical, provider-owned configuration mutation coordinator.
  • Apply actual administrator, updater/config-busy, and in-flight disabled semantics to provider forms, default-model controls, and OAuth logout actions while keeping an already-open credential form cancellable.
  • Preserve committed provider/default-model changes and visible success-plus-warning feedback when authoritative configuration refresh fails.
  • Allow intentionally global configuration writes to complete across agent switches without letting their stale completion clear another agent's credential, Add-provider, or default-model draft.
  • Stop truly agent-scoped queued OAuth logout targets after an agent switch, including A→B→A and route-data-driven selection changes.

Root causes fixed

5 independently reproduced provider-owner defects:

  1. Revoked/in-flight Add-provider form admission. Once opened, provider and password inputs remained interactive after mutation permission was revoked or the Add write was in flight; the enabled Save button still dispatched its callback. Lock native controls while preserving Cancel except during the form's own in-flight mutation.
  2. Shared configuration/update busy state ignored. Default-model selectors, fallback actions, provider key editors, Add-provider actions, and logout controls ignored the existing shared configuration/updater write lock while adjacent model-behavior controls respected it.
  3. Committed mutations reported or displayed incorrectly after refresh failure. The configuration owner resolves ordinary refresh failures while recording state.lastError; treating rejection alone as failure detection hid committed-success warnings. New providers also had no rendered card after a failed refresh, causing success and warnings to disappear; default-model drafts reverted to stale loaded selections. Preserve committed success, show accessible warnings, keep Add feedback visible while clearing its password, and retain committed default selections until authoritative refresh succeeds.
  4. Global mutation completions contaminated replacement-agent UI. Provider keys, provider additions, and default models are intentionally global configuration writes and must still commit after the selected agent changes, but their previous completion paths cleared another agent's credential/default drafts or published stale busy/messages. Monotonic agent epochs now gate only agent-local UI effects while preserving global writes.
  5. Agent-owned OAuth logout continued into a stale scope. A grouped logout awaited its first RPC, then dispatched remaining OAuth targets for the former agent after selection changed. Stop undispatched targets on every scope transition, including A→B→A and route-data selection changes, and clear old scoped busy/messages/probe/confirmation state.

Red-to-green owner evidence

  • Existing owner baseline: 30 passing tests.
  • Added first-pass actual Lit DOM/controller regressions: 6 failing, 30 passing, proving revoked/in-flight Add controls, ignored config-busy controls, committed-refresh failure, stale replacement-agent draft cleanup, and queued old-agent logout.
  • Added independent-review regressions for truthful refresh()/state.lastError behavior, persistently visible Add/default warnings, cancellable locked credential forms, assertive accessible error alerts, agent-switch ABA, route-data scope reset, and all three global mutation completion paths.
  • Final exact-commit focused DOM/controller proof:
node scripts/run-vitest.mjs \
  ui/src/pages/model-providers/view.test.ts \
  ui/src/pages/model-providers/model-providers-page.test.ts

Result: 44 tests passed across 2 files.

  • Adjacent provider owner/serialization/load proof:
node scripts/run-vitest.mjs \
  ui/src/pages/model-providers/data.test.ts \
  ui/src/pages/model-providers/load.test.ts \
  ui/src/pages/model-providers/mutations.test.ts

Result: 19 tests passed across 3 files.

Total: 63 passing provider-owner and sibling tests.

Full remote changed-file gate

Trusted Blacksmith Testbox tbx_01kyw0rj16bksrzy71pp6vpzxb passed the exact six-file gate:

node scripts/check-changed.mjs --base origin/main --head HEAD -- \
  ui/src/pages/model-providers/config-mutation.ts \
  ui/src/pages/model-providers/default-models-view.ts \
  ui/src/pages/model-providers/model-providers-page.test.ts \
  ui/src/pages/model-providers/model-providers-page.ts \
  ui/src/pages/model-providers/view.test.ts \
  ui/src/pages/model-providers/view.ts
  • Result: exit 0, 341.241 seconds command time, 343.133 seconds total.
  • Passed conflict markers, strict maximum-line ratchet, changelog and package-policy guards, wildcard/export checks, dependency pins, six-file formatting, zero-dead-export scans, Control UI i18n verification, core-test TypeScript, UI TypeScript, and changed-file oxlint (0 warnings, 0 errors).
  • The sparse isolated checkout was safely materialized into a temporary full sync checkout; changed-gate comparison remained anchored at immutable merge base 59e1d586147b98f0021fc9ff176d64214ad435c4.
  • Workflow: https://github.com/openclaw/openclaw/actions/runs/30629044283. The one-shot Testbox was stopped after success; its delegated Actions step may display cancelled after successful lease cleanup.
  • Real TruffleHog 3.96.0 secret scan: clean.
  • Commit-specific structured isolated Codex autoreview (gpt-5.6-sol, high reasoning): CLEAN, zero actionable findings, confidence 0.95.
  • Separate strict read-only provider-owner review: CLEAN, including global-vs-agent ownership, route-data/ABA races, genuine refresh failure semantics, native disabled controls, and accessibility.

Candidate

  • Branch: codex/qa100-model-provider-mutation-owner.
  • Commit: ee0a71c522795729868a7e28e9fe66639ba47d2f.
  • Immutable parent: 59e1d586147b98f0021fc9ff176d64214ad435c4.
  • Scope: exactly six internal Control UI provider-owner files; no Skills/fix(ui): preserve Skills credentials and serialize configuration updates #116749 overlap, no configuration/schema/API/auth surface, no fetch, no push, and no shared-main modification.
  • Known separate owner limitation intentionally untouched: legacy hash-only RuntimeConfigCapability.patch acknowledgements collapse committed-refresh failure into false; correcting that requires separately approved shared-configuration-owner contract work.

@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: 🦪 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. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 8:13 AM ET / 12:13 UTC.

ClawSweeper review

What this changes

This PR centralizes Model Provider settings mutations, applies consistent disabled states, preserves committed-change feedback through refresh failures, and prevents stale agent-scoped UI effects during provider and OAuth operations.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep this active, maintainer-labeled Control UI repair open for normal maintainer review. The supplied test and changed-file gate evidence supports a focused patch, but the PR body only demonstrates DOM/controller and automated checks; it does not yet show after-fix behavior in a real Control UI browser session.

Priority: P2
Reviewed head: ee0a71c522795729868a7e28e9fe66639ba47d2f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has substantial focused automated evidence, but missing real Control UI behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR provides focused DOM/controller tests and a changed-file gate, but no after-fix browser session, recording, screenshot sequence, terminal/live output, or redacted runtime log that directly shows the operator-visible behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides focused DOM/controller tests and a changed-file gate, but no after-fix browser session, recording, screenshot sequence, terminal/live output, or redacted runtime log that directly shows the operator-visible behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 3 items Focused implementation scope: The PR changes six internal Control UI provider-settings files and adds a dedicated configuration-mutation coordinator; the stated scope does not add dependencies, protocol APIs, config schema, or authentication storage surfaces.
Automated validation supplied: The PR body reports 63 focused provider-owner and sibling tests passing, plus a successful changed-file gate for the exact six-file scope. This is useful regression coverage but does not itself demonstrate an after-fix real browser session.
Protected review routing: The PR currently carries the repository's maintainer label, so conservative cleanup must leave it open for explicit maintainer handling rather than auto-close or auto-merge routing.
Findings None None.
Security None None.

How this fits together

The Control UI’s Model Provider page lets an operator edit shared provider configuration and agent-specific OAuth state through the gateway. A configuration mutation can persist globally, while its busy state, drafts, feedback, and queued logout work must remain scoped to the currently selected agent.

flowchart LR
  A[Provider settings page] --> B[Mutation coordinator]
  B --> C[Shared runtime configuration]
  B --> D[Agent-scoped OAuth actions]
  C --> E[Provider data refresh]
  D --> F[Selected-agent scope check]
  E --> G[Visible success or warning]
  F --> G
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides focused DOM/controller tests and a changed-file gate, but no after-fix browser session, recording, screenshot sequence, terminal/live output, or redacted runtime log that directly shows the operator-visible behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The patch changes UI ownership across shared configuration writes and selected-agent state; automated tests cover the claimed races, but there is no independently inspectable real-browser proof that an operator sees the intended disabled controls, retained drafts, and success-plus-warning feedback.
  • Complete next step (P2) - This maintainer-labeled PR has no concrete code finding from the supplied evidence, but it needs contributor-provided real browser proof and explicit maintainer review rather than an automated repair.
Agent review details

Security

None.

PR surface

Source +147, Tests +411. Total +558 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 266 119 +147
Tests 2 412 1 +411
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 678 120 +558

Review metrics

Metric Value Why it matters
Provider-owner regression coverage 63 focused tests across 5 files The asserted coverage spans coordinator, rendering, data, load, and mutation behavior, which is useful evidence for the cross-scope state changes.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep global configuration writes in the provider-owned coordinator while limiting stale-completion cleanup to the initiating agent scope, then attach a redacted real Control UI browser recording or screenshot sequence covering a refresh-warning save and an agent-switch/logout case.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep global configuration writes in the provider-owned coordinator while limiting stale-completion cleanup to the initiating agent scope, then attach a redacted real Control UI browser recording or screenshot sequence covering a refresh-warning save and an agent-switch/logout case.

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

No high-confidence live reproduction was independently established. The PR supplies focused DOM/controller regressions for the claimed failures, making the paths source-reproducible but not independently reproduced in a current browser session.

Is this the best way to solve the issue?

Unclear. A single provider-owned coordinator is a plausible boundary because the patch distinguishes global configuration persistence from agent-local UI cleanup, but the full current-main caller and runtime-config contract could not be independently inspected here.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded Control UI reliability repair with limited blast radius, but it affects normal provider-configuration workflows.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides focused DOM/controller tests and a changed-file gate, but no after-fix browser session, recording, screenshot sequence, terminal/live output, or redacted runtime log that directly shows the operator-visible behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Control UI reliability repair with limited blast radius, but it affects normal provider-configuration workflows.
  • 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 real behavior proof before merge: The PR provides focused DOM/controller tests and a changed-file gate, but no after-fix browser session, recording, screenshot sequence, terminal/live output, or redacted runtime log that directly shows the operator-visible behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Focused implementation scope: The PR changes six internal Control UI provider-settings files and adds a dedicated configuration-mutation coordinator; the stated scope does not add dependencies, protocol APIs, config schema, or authentication storage surfaces. (ui/src/pages/model-providers/config-mutation.ts:1, ee0a71c52279)
  • Automated validation supplied: The PR body reports 63 focused provider-owner and sibling tests passing, plus a successful changed-file gate for the exact six-file scope. This is useful regression coverage but does not itself demonstrate an after-fix real browser session. (ui/src/pages/model-providers/model-providers-page.test.ts:1, ee0a71c52279)
  • Protected review routing: The PR currently carries the repository's maintainer label, so conservative cleanup must leave it open for explicit maintainer handling rather than auto-close or auto-merge routing.

Likely related people:

  • steipete: The supplied PR context attributes the focused provider-settings repair and accompanying regression coverage to this contributor; current-main ownership history could not be independently inspected in this read-only session. (role: proposed patch author and likely follow-up contact; confidence: low; commits: ee0a71c52279; files: ui/src/pages/model-providers/config-mutation.ts, ui/src/pages/model-providers/model-providers-page.ts, ui/src/pages/model-providers/view.ts)

Rank-up moves

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

  • Add redacted Control UI browser proof showing disabled provider controls during shared config activity and an accessible committed-success-plus-refresh-warning result.
  • Show an agent switch while a global provider save or queued OAuth logout is in flight, confirming that stale agent-local drafts and logout targets do not affect the replacement scope.

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.

@steipete
steipete merged commit 18cd6ee into main Jul 31, 2026
109 of 113 checks passed
@steipete
steipete deleted the codex/qa100-model-provider-mutation-owner branch July 31, 2026 12:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L 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