Skip to content

refactor(ui): simplify MCP context presentation state - #174100

Merged
steipete merged 1 commit into
mainfrom
solid2/w-idiom-core-context
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-idiom-core-context

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The MCP context strip maintained a revision signal beside the shared context owner and copied its pending-removal Set on every update. It now consumes that owner through projectSource and keeps pending view IDs in a local Solid store. Gateway request admission, stale-response checks, and context publication remain with the existing owners.

User Impact

This is an internal UI refactor. Context removal, error recovery, and rendered markup remain unchanged.

Why This Change Was Made

The subscription is scoped to client, session, and agent. Replacing the scope disposes the previous projection. Post-await checks no longer use redundant untrack calls; the Gateway event boundary deliberately remains untracked. The existing removal test now covers a failed request re-enabling its button, followed by a successful idempotent retry.

Evidence

Proof Result
UI typecheck Passed
Focused context-strip tests 3 passed; 8.57 s wall time, 56 ms test time
Scoped lint and formatting Passed; git diff --check passed
Production Knip Passed (3m 39s)
Independent review No actionable P0–P2 findings; subscription helper inspected locally and its cleanup test passed
CI Full UI selection requested with ci:full
Visual/startup No markup, styles, or startup-import changes. No local build or screenshot run under the campaign's bounded-proof policy. Startup bytes were not remeasured.

Checklist metrics for the touched production file, against e8cc6196dc8051fe0115a5d118761d8b4a9eebef:

Metric Before After
Production LOC 236 234
Controller-pattern lines 0 0
createEffect calls 0 0
createRenderEffect calls 1 0
untrack calls 3 1
Native listener registrations 0 0
DOM queries 0 0
Hand-built class strings 0 0
flush calls 0 0
Owner capture/restoration calls 0 0
createStore calls 0 1

The wider lib/reactive + components/solid scope has zero controller-pattern lines. Its shared controller-host adapter still has eight lines and remains required by both assistant-panel renderers and the board session-progress widget. Those callers belong to ongoing area-lane work; this PR does not duplicate their migration.

Test LOC: 152 → 164 (+12), extending an existing removal scenario rather than adding a parallel test fixture.

Whole-UI AST inventory at the pinned base: 905 controller-pattern references across 197 production files; the ratchet remains advisory until that baseline reaches zero.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T10:18:02.058344Z 43bb073 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR replaces manual MCP context revision tracking with a shared projection and stores pending removals in local Solid state.

Example: Removing the “Hex bolt” attachment fails once, then succeeds on retry.

  • Before: The chip remains after failure, its remove button becomes available again, and a successful retry clears it.
  • After: The same behavior is preserved through the shared projection and local store, with the failure-and-retry sequence explicitly tested.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent; supplied behavioral validation is limited to mounted components with mocked Gateway requests.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts this PR from the ordinary contributor proof gate; its reported mounted-component tests cover retry and subscription cleanup, while no changed-path browser evidence is supplied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
User problem: No new user-visible defect is claimed; existing attachment display, consumption, and removal behavior must remain intact.
Reason: The supplied maintainer-authored classification establishes direction, and the narrow change follows the repository's existing projection and presentation-state ownership rules.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, maintainer-directed simplification, and source review found no actionable introduced defect.

Priority: P3
Reviewed head: 43bb073c24b190b821a60b654d59ba0b4c44f6f1

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence contains mounted-component tests, with no shipped-browser run of attachment removal or scope replacement.
Agent review details

How this fits together

The Control UI context strip reads connection-scoped MCP attachments, displays composer chips, and sends removal requests through the existing Gateway client.

flowchart LR
  A[MCP app updates] --> B[Shared context owner]
  B --> C[Source projection]
  C --> D[Composer context strip]
  D --> E[Gateway removal request]
  E --> B
  D --> F[Local pending state]
Loading

Technical review

Best possible solution:

Retain this focused projection refactor and land it when the existing required CI gate permits.

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

This PR claims a behavior-preserving refactor rather than a current product defect; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Using the existing projection adapter and a local presentation store removes duplicated bookkeeping without transferring Gateway authority or changing public behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c72336d390c0.

Provenance checked

  • MCP context subscription and pending-removal presentation keeps the original intent (91fd61d: The Solid migration preserved existing MCP tags, classes, state owners, and user flows; this PR changes only their reactive presentation plumbing.)
  • Consumed-context and idempotent-removal test keeps the original intent (e9060685284bd91728b92ce553d7b4e02731e6db2805ad: Live testing established that consumed context must clear and already-consumed removal must succeed; the existing scenario remains and gains failed-request retry coverage.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -2, Tests +12. Total +10 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 25 27 -2
Tests 1 15 3 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 40 30 +10

Labels

Label changes:

  • add P3: This is a behavior-preserving presentation-state cleanup with no established user-facing regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a behavior-preserving presentation-state cleanup with no established user-facing regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 6:29 AM ET / 10:29 UTC.

@steipete
steipete merged commit 5dc0df1 into main Oct 16, 2026
105 of 107 checks passed
@steipete
steipete deleted the solid2/w-idiom-core-context branch October 16, 2026 10:43
@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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

1 participant