Skip to content

fix(ui): retire stale MCP feedback across context changes - #128490

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:fix/mcp-settings-stale-feedback
Sep 3, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:fix/mcp-settings-stale-feedback

Conversation

@Alix-007

@Alix-007 Alix-007 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An MCP settings mutation could finish after its Control UI owner entered a new application context. The old completion then locked the current controls or published stale success or error feedback.

Root cause

The MCP settings card and the Plugins MCP controller owned their busy and message state, but they did not retire pending async work at their runtime-config subscription cleanup boundary. The card's initial config load also used only connection and source checks, which allowed an old rejection after reconnect with the same source.

Fix

  • Retire MCP busy and message state when the runtime-config lifecycle ends.
  • Fence mutation and initial-load completions with the owning feedback generation.
  • Apply the same invariant to the Plugins MCP controller, including connector-row busy state.
  • Preserve current main's exact-array deletion behavior and queued-write coverage.

Proof

  • Current-main red: a branch-built Control UI called a real isolated Gateway, changed application context while config.patch was pending, and then displayed the old Gateway error in the retained card.
  • Exact-head green: the same flow on 6874b6d8c9fa8978247b989da78b4750a82b8542 kept the current control enabled and showed no stale status or alert.
  • Focused tests: 50 passed across the MCP settings card and Plugins page.
  • Regression red: the new tests produced three intended failures on the pre-fix production code.

Production delta: +21 net lines. The growth records and enforces lifecycle ownership in both MCP feedback owners. Tests add direct card, load-error, and Plugins regressions.

Review disposition

ClawSweeper's production-growth line-item is accepted. The 21 lines keep busy and message ownership inside the two MCP UI owners; the generic subscription controller cannot own component-specific feedback. The repair also removes the Plugins controller's redundant local catch/finally path.

Config, protocol, schema, security, and upgrade impact: none.

AI disclosure: Codex assisted with the repair and validation. Alix-007 remains the accountable contributor.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

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

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 8:01 AM ET / 12:01 UTC.

ClawSweeper review

What this changes

The PR makes MCP settings controls discard pending busy, success, and error feedback when a retained Control UI card or Plugins page changes runtime configuration context.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open as a correct, proof-backed fix: its generation fence resets UI-owned feedback at the runtime-config lifecycle boundary and prevents an earlier mutation or load completion from affecting the replacement context.

Priority: P2
Reviewed head: 6874b6d8c9fa8978247b989da78b4750a82b8542

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with direct regression coverage and concrete isolated-Gateway before/after evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The changed production owners are the MCP card and Plugins controller; the PR supplies an exact-head isolated-Gateway context-switch scenario that reports the current control stayed enabled and no stale status or alert appeared after the earlier mutation completed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The changed production owners are the MCP card and Plugins controller; the PR supplies an exact-head isolated-Gateway context-switch scenario that reports the current control stayed enabled and no stale status or alert appeared after the earlier mutation completed.
Evidence reviewed 5 items Introduced lifecycle fence: The card captures its feedback generation before a mutation and rejects completion after cleanup; cleanup clears busy and message state before a new runtime-config source can reuse the retained element.
Plugins-page owner boundary: The controller now clears its own section feedback and connector-row busy key during runtime-config subscription cleanup, then ignores an old mutation result after the generation changes.
Runtime-config notification contract: The capability publishes before and after asynchronous config work; therefore the retained subscription updates rows when an initial load completes, while the PR's error fence only suppresses stale feedback.
Findings None None.
Security None None.

How this fits together

The Control UI reads saved MCP server definitions from the active runtime configuration and lets an administrator mutate them. Its MCP card and Plugins page convert those operations into row controls and operator feedback.

flowchart LR
  A[Application context] --> B[Runtime configuration]
  B --> C[MCP settings card]
  B --> D[Plugins MCP controller]
  C --> E[Feedback generation check]
  D --> E
  E --> F[Current controls and status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +21, Tests +119. Total +140 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 65 44 +21
Tests 2 122 3 +119
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 187 47 +140

Review metrics

Metric Value Why it matters
Production versus test delta production +21 net (+65/-44); tests +119 net (+122/-3) The added production state is bounded to the two UI feedback owners and is covered by context-replacement regressions.

Technical review

Best possible solution:

Retain the two owner-local generation fences and focused lifecycle regressions; a shared subscription controller should not absorb component-specific busy and message ownership.

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

Yes: the supplied exact-head evidence describes an isolated Gateway run that changes context while a config mutation is pending, then observes whether the retained UI shows old feedback or locks its current control.

Is this the best way to solve the issue?

Yes: fencing completion at each feedback owner's runtime-config cleanup boundary fixes the stale producer result without changing MCP configuration, protocol, or Gateway behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs stale Control UI feedback in MCP settings, with a limited and non-security user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The changed production owners are the MCP card and Plugins controller; the PR supplies an exact-head isolated-Gateway context-switch scenario that reports the current control stayed enabled and no stale status or alert appeared after the earlier mutation completed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are the MCP card and Plugins controller; the PR supplies an exact-head isolated-Gateway context-switch scenario that reports the current control stayed enabled and no stale status or alert appeared after the earlier mutation completed.

Evidence

What I checked:

  • Introduced lifecycle fence: The card captures its feedback generation before a mutation and rejects completion after cleanup; cleanup clears busy and message state before a new runtime-config source can reuse the retained element. (ui/src/components/mcp-servers-card.ts:62, 6874b6d8c9fa)
  • Plugins-page owner boundary: The controller now clears its own section feedback and connector-row busy key during runtime-config subscription cleanup, then ignores an old mutation result after the generation changes. (ui/src/pages/plugins/plugins-mcp-controller.ts:130, 6874b6d8c9fa)
  • Runtime-config notification contract: The capability publishes before and after asynchronous config work; therefore the retained subscription updates rows when an initial load completes, while the PR's error fence only suppresses stale feedback. (ui/src/lib/config/runtime-config-capability.ts:102, a590cc31e12f)
  • Regression coverage and real-flow evidence: New tests cover a pending mutation across a retained card/page context replacement and a stale initial-load rejection; the PR body records a real isolated-Gateway before/after run on this exact head with no stale alert/status and an enabled current control. (ui/src/components/mcp-servers-card.test.ts:512, 6874b6d8c9fa)
  • Current-main and feature history: Current main still lacks this PR's generation-based cleanup in all three production owners. The original MCP Settings surface was introduced by Peter Steinberger's shipped feature commit. (ui/src/pages/plugins/plugins-page.ts:247, a590cc31e12f)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (8 earlier review cycles)
  • reviewed 2026-08-24T04:31:38.118Z sha a3b095ff4bfe46490718513f2d59645aef5c885e :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-24T05:16:04.315Z sha a3b095ff4bfe46490718513f2d59645aef5c885e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T10:10:23.714Z sha a3b095ff4bfe46490718513f2d59645aef5c885e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T13:18:14.670Z sha 358754fb984ac77bdeb2221a265aea6be14151b5 :: needs real behavior proof before merge. :: [P1] Guard completion against the current config source
  • reviewed 2026-09-03T03:12:40.070Z sha fe27cee62b5d5381dc7a25ce1d91679f1e22463c :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-03T04:03:17.398Z sha fe27cee62b5d5381dc7a25ce1d91679f1e22463c :: blocked before merge. :: none
  • reviewed 2026-09-03T05:11:18.775Z sha f617357 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-03T11:26:59.820Z sha 6874b6d :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Aug 24, 2026
@Alix-007

Alix-007 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 1, 2026
@Alix-007
Alix-007 force-pushed the fix/mcp-settings-stale-feedback branch from 358754f to fe27cee Compare September 3, 2026 03:04
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. 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. labels Sep 3, 2026
@Alix-007
Alix-007 force-pushed the fix/mcp-settings-stale-feedback branch from fe27cee to f617357 Compare September 3, 2026 05:02
@obviyus obviyus changed the title fix(ui): clear stale MCP feedback after context change fix(ui): retire stale MCP feedback across context changes Sep 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: S labels Sep 3, 2026
@obviyus obviyus closed this Sep 3, 2026
@obviyus obviyus reopened this Sep 3, 2026
@obviyus
obviyus merged commit 13b1f71 into openclaw:main Sep 3, 2026
475 of 488 checks passed
@obviyus

obviyus commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Alix-007!

Proof: A branch-built Control UI called a real isolated Gateway while an MCP mutation crossed an application-context change. Current main showed the old feedback in the retained card; the merged head kept the current control enabled with no stale alert or status.

  • Bug: An older MCP mutation or config load could publish busy, success, or error feedback into a newer Control UI context.
  • Fix: The MCP settings card and Plugins MCP controller now retire feedback at runtime-config cleanup and ignore completions from older feedback generations.
Before After
The replacement context could inherit disabled controls or stale MCP feedback. The current context owns its controls and feedback; older completions have no visible effect.

CI run 33752179871, attempt 1, completed with two proven unrelated failures:

  • failed: checks-node-compact-small-6 job=100638277809 conclusion=failure — the inherited fake CLI timeout test was removed on current main and does not overlap this PR.
  • failed: checks-ui-e2e-real-gateway job=100638274814 conclusion=failure — the unchanged QA Lab device-state test observed pending-approval instead of unauthorized; it does not import the changed MCP UI owners.

All checks that cover the changed Control UI source, tests, types, lint, internationalization, build, and performance passed. Exact-head Autoreview reported no actionable findings.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
* commit '13b1f71c7010baaf2394555198e2fc04bef03586': (283 commits)
  fix(ui): retire stale MCP feedback across context changes (#128490)
  fix(agents): clarify set-identity workspace output (#126320)
  fix(auth): preserve OAuth metadata during session SDK refresh (#127988)
  fix(agents): recover catalog worker after generation mismatch (#127712)
  fix(memory-wiki): reject out-of-range claim confidence (#125656)
  ci: remove redundant contract runs and costly test work (#137220)
  fix(release): assert the Codex CLI pin the candidate declares (#137136)
  test(voice-call): reuse shared guards and deferred gates (#137262)
  fix(cron): isolate scheduler-disabled shared-store writes (#131733)
  fix(telegram): surface allowed custom reactions in react guidance (#129817)
  test(infra): reuse the shared npm call presence guard (#137254)
  fix: generated images disappear after failed tool calls (#131226)
  fix(docs): match source anchor checks to published sections (#137157)
  fix(backup): preserve audit capture across slow snapshots (#130962)
  fix(release): preserve legacy gh log reads (#137016)
  fix(memory-core): make forget rewrites atomic (#131383)
  fix(agents): write settings atomically (#131431)
  fix(plugins): keep the memory indexing runtime with the selected slot owner (#131779)
  fix(ci): pin iOS screenshot evidence to workflow revision (#136334)
  test(logging): remove redundant stderr spy casts (#137238)
  ...

# Conflicts:
#	scripts/e2e/lib/codex-release-package-assertions.mjs
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…28490)

## Problem

An MCP settings mutation could finish after its Control UI owner entered a new application context. The old completion then locked the current controls or published stale success or error feedback.

## Root cause

The MCP settings card and the Plugins MCP controller owned their busy and message state, but they did not retire pending async work at their runtime-config subscription cleanup boundary. The card's initial config load also used only connection and source checks, which allowed an old rejection after reconnect with the same source.

## Fix

- Retire MCP busy and message state when the runtime-config lifecycle ends.
- Fence mutation and initial-load completions with the owning feedback generation.
- Apply the same invariant to the Plugins MCP controller, including connector-row busy state.
- Preserve current main's exact-array deletion behavior and queued-write coverage.

## Proof

- Current-main red: a branch-built Control UI called a real isolated Gateway, changed application context while `config.patch` was pending, and then displayed the old Gateway error in the retained card.
- Exact-head green: the same flow on `6874b6d8c9fa8978247b989da78b4750a82b8542` kept the current control enabled and showed no stale status or alert.
- Focused tests: 50 passed across the MCP settings card and Plugins page.
- Regression red: the new tests produced three intended failures on the pre-fix production code.

Production delta: +21 net lines. The growth records and enforces lifecycle ownership in both MCP feedback owners. Tests add direct card, load-error, and Plugins regressions.

## Review disposition

ClawSweeper's production-growth line-item is accepted. The 21 lines keep busy and message ownership inside the two MCP UI owners; the generic subscription controller cannot own component-specific feedback. The repair also removes the Plugins controller's redundant local catch/finally path.

Config, protocol, schema, security, and upgrade impact: none.

AI disclosure: Codex assisted with the repair and validation. Alix-007 remains the accountable contributor.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants