Skip to content

fix(mcp): keep embedded MCP requests' intermediate results off the GUI - #1172

Draft
Claudius-Maginificent wants to merge 2 commits into
v1.0-devfrom
fix/mcp-results-off-gui
Draft

Claudius-Maginificent wants to merge 2 commits into
v1.0-devfrom
fix/mcp-results-off-gui

Conversation

@Claudius-Maginificent

Copy link
Copy Markdown
Collaborator

TL;DR

When an AI assistant or the command-line tool works with the running app through its built-in MCP server, the progress and errors of that work no longer pop up on whatever screen you have open. The app only refreshes the data that changed.

User story

As a user running Dash Evo Tool while an assistant uses its MCP server, I want the screen I'm looking at to show only what I started, so that I'm not shown banners or state changes from someone else's request.

Scenario

Steps to reproduce

  1. Run the GUI with the embedded MCP server enabled and open any screen.
  2. From an MCP client (for example det-cli over HTTP), call a tool whose task reports intermediate results.

Actual behavior

Intermediate results of the MCP request, such as progress, a fetched nonce or a logged proof error, reach the screen in view. Nothing records an owner for them, so they are routed to the visible screen.

Expected behavior

The GUI hears only that cached data changed, plus a network switch's context registration. The MCP caller still gets its result from the call.

Detailed discussion

  • SenderAsync::keeping_only(fn(&T) -> bool) (utils/egui_mpsc.rs) adds a synchronous filter. A rejected message is accepted and dropped, returning Ok, so no task fails with a send error. Clone keeps the filter.

  • SenderAsync::unfiltered() returns a copy without it.

  • mcp::dispatch::task_reporter(ctx) hands every MCP request the frame-loop sender filtered to CacheUpdated | Repaint.

  • Every site that keeps a sender for good now takes unfiltered(), whoever handed it over:

    • AppContext::install_frame_loop
    • ensure_wallet_backend (the sender stored in WalletBackend)
    • the NetworkContextRegistered send in run_switch_network

    A filtered per-request sender can therefore never be stored. A network switch requested over MCP still registers its context with AppState, and the backend's events (event bridge, identity and shielded sync, platform-ready trigger) keep reaching the GUI.

  • GUI-dispatched tasks are unaffected: they already pass an unfiltered sender.

  • The one subtask that outlives a request, fee_payer_balance_refresh, sends only CacheUpdated.

  • SenderAsync::sender() is removed (it had no callers and bypassed the filter).

  • The AGENTS.md "Result routing" sentence is updated.

  • Regression from refactor(app): let each domain decide its reactions to backend results #1157, which routed embedded-MCP reports to the GUI's frame loop. Found during the 2026-11-10 weekly release review.

Testing

  • utils::egui_mpsc::tests::a_filtered_sender_passes_only_what_it_keeps
  • mcp::dispatch::tests::a_request_tells_the_frame_loop_only_that_cached_data_changed (through dispatch_task)
  • backend_task::tests::a_switch_through_a_filtered_sender_installs_the_frame_loop_unfiltered
  • The new behaviour tests failed before the change. --lib mcp:: … gave 78 passed. Clippy is clean.
  • An independent review approved after two rounds.
  • Not covered: an end-to-end proof through dispatch_task_with that an intermediate is filtered, because no MCP-dispatchable task emits a non-cache intermediate offline.

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

lklimek and others added 2 commits November 10, 2026 11:32
…bedded in

A task requested through the MCP server embedded in the GUI reported
through the GUI's frame loop. Progress and other intermediate results
it sent there had no screen owner, so they went to the screen in view
and could raise banners for an operation the user did not start. The
requested task now reports through a sender that passes only cache
changes and repaints; the caller still gets the result from the call.
The sender stays unfiltered where the task keeps it for good: a
network switch, which registers its new context with the GUI, and the
first wallet-touching task, which wires the wallet backend on it.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A filtered request sender must never be kept for good. The context's
frame loop, the wallet backend and a network switch's context
registration now take the sender's unfiltered copy, whoever handed it
over, so every MCP request reports through the filtered sender with no
exception for the request that wires the wallet backend or switches
the network. The raw channel accessor that bypassed the filter is
removed, as nothing used it.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 51987fb. Normal review starts when eligible; priority review starts as soon as a slot is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants