Repository navigation
fix(ui): isolate MCP context removal feedback - #179843
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR isolates pending MCP context-removal feedback across client and session replacements. Example: Remove view-one in agent:main:one, then switch to agent:main:two containing another view-one before the first request settles.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current UI state leak, preserves existing mutation checks, and introduces no actionable code or security findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe chat composer’s MCP context strip reads connection-scoped context entries, sends removal requests through the Gateway client, and renders pending buttons and errors. flowchart LR
A[Chat composer] --> B[MCP context strip]
B --> C[Gateway removal request]
C --> D[Scoped result checks]
D --> E[Context projection]
E --> B
B --> F[Optimistic button feedback]
Technical reviewBest possible solution: Keep Gateway request settlement authoritative while giving each admitted removal independently scoped optimistic feedback. Do we have a high-confidence way to reproduce the issue? Current main stores pending state solely by view ID while the component can change client or session; the supplied regression cases reproduce that path, although no tests were executed during this read-only review. Is this the best way to solve the issue? The patch uses existing Solid presentation primitives, removes shared pending cleanup, and retains captured-target and update-ID checks without adding another mutation owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 548a331adb18. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +28, Tests +87. Total +115 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 4:58 PM ET / 20:58 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03493e1fd4
ℹ️ 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".
| setPending((value) => { | ||
| value[viewId] = current; | ||
| }); |
There was a problem hiding this comment.
Key overlapping removals by presentation scope
When a removal in scope A remains pending, the user can switch to scope B with the same viewId, start another removal, and then return to A before either settles. Both actions write the same pending[viewId] slot, so B's newer optimistic layer masks A's accessor; in scope A it evaluates false and re-enables the button even though A's request is still in flight, allowing a duplicate removal. Key the pending state by the full connection/session/agent presentation or preserve all active predicates instead of overwriting one view-ID slot.
AGENTS.md reference: ui/AGENTS.md:L16-L18
Useful? React with 👍 / 👎.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Whole assigned-scope AST census at exact integrated base
40a236feb0c3→ head. Counts are syntax/adoption inventory; plain owner and lifecycle exceptions are classified below.What Problem This Solves
A pending context removal stayed keyed only by view ID. Replacing the Gateway client or session with a context using the same view ID inherited the old disabled state; old settlement could also clear a successor's feedback. This change gives each admitted removal a Solid optimistic presentation layer scoped by its existing current-target predicate.
User Impact
A new context stays removable while an older removal is still settling; failures retain the existing visible retry.
Why This Change Was Made
The Gateway request, captured target, connection scope, and update ID checks still own admission and publication. The action only presents pending feedback and consumes the already-admitted operation. It adds no RPC, refresh, generation, or rollback store. Expected failures retain the visible error and retry behavior.
Evidence
The two cleanup registrations retire event subscriptions and the current-target predicate synchronously when the host unmounts, including while an action is held. Deferring them through settled presentation would weaken that contract. The context owner exposes a synchronous published snapshot rather than a read request, so no async read or
affects/refreshcycle is introduced.No layout, styling, text, tag, class, route, or import boundary changes. The regression tests exercise the actual rendered button states; no new visual design is introduced. Production LOC: 205 → 233 (+28), needed to keep authoritative operation settlement outside Solid's presentation transaction while removing shared pending cleanup. Test LOC: 111 → 198 (+87). The first baseline attempt stopped during cold setup and is not used as failure evidence; the configured second attempt executed and failed both regression assertions.
Strict paired performance passed with zero violations; same machine, toolchain and normalized build identity. The official comparison omitted base startup metadata, so the baseline alone was rebuilt once to record it; the already-built candidate was reused.
The final catch callback received a type-only
unknownannotation after review. The first final-lint invocation was stopped during unnecessary plugin artifact preparation (missing UI tsconfig), before a lint verdict; the corrected two-file invocation usestsconfig.ui.json. Runtime test/build evidence is unchanged.Full
ci:fullrun 39687247707 on exact integrated head03493e1fd437a8c5fb0dd4a2d064d3d97a335694completed. Its only failing test isChat boot render storm > prewarms session actions after a busy cold load without building unrelated menus or losing the draft(job119524885657), theMessage permissionsvisibility timeout at line233. The exact name and signature match latest completed scheduled main 39687169253, job119524443291. All other root jobs pass or skip, including every UI unit shard and remaining E2E shard. Native inherited-failure admission covers this assertion; the old mixed-attachment packet is retired.Synthetic before/after capture (same styling and data):
The replacement action stays enabled after the change; the admitted predecessor request is unchanged. All four images were inspected; browser errors: none.