Skip to content

fix(apps): restore MCP app sampling support reverted by #6933#7366

Merged
aharvard merged 1 commit intomainfrom
fix/restore-mcp-app-sampling
Feb 19, 2026
Merged

fix(apps): restore MCP app sampling support reverted by #6933#7366
aharvard merged 1 commit intomainfrom
fix/restore-mcp-app-sampling

Conversation

@aharvard
Copy link
Collaborator

Problem

PR #6933 (local inference provider) was based on a stale branch that didn't include #7039's sampling changes to McpAppRenderer.tsx. When it merged ~16 hours after #7039, it silently reverted all client-side sampling plumbing.

What was lost

The following code from #7039 was removed from McpAppRenderer.tsx:

  • RequestHandlerExtra import from @mcp-ui/client
  • JSONRPCRequest import from @modelcontextprotocol/sdk/types.js
  • SamplingCreateMessageParams / SamplingCreateMessageResponse type imports
  • apiHost / secretKey state variables + initialization useEffect
  • handleFallbackRequest callback (~35 lines) that handles sampling/createMessage requests
  • onFallbackRequest={handleFallbackRequest} prop on <AppRenderer>

What survived

These parts of #7039 were not affected (different files):

  • ✅ Server-side sampling route (crates/goose-server/src/routes/sampling.rs)
  • ✅ Route wired up in mod.rs
  • ✅ Sampling types in types.ts
  • chat.html demo app + cache registration

Fix

This PR restores the exact code that #7039 added and #6933 removed. The @mcp-ui/client SDK (v6.1.0) still supports onFallbackRequest — confirmed in the bundled code.

Verification

PR #6933 (local inference provider) was based on a stale branch that
didn't include #7039's sampling changes to McpAppRenderer.tsx. When it
merged, it silently reverted all client-side sampling plumbing:

- RequestHandlerExtra and JSONRPCRequest imports
- SamplingCreateMessageParams/Response type imports
- apiHost/secretKey state + initialization useEffect
- handleFallbackRequest callback (sampling/createMessage handler)
- onFallbackRequest prop on AppRenderer

The server-side route (sampling.rs), types.ts, and chat.html all
survived — only the McpAppRenderer.tsx wiring was lost.

This restores the exact code that #7039 added and #6933 removed.
Copilot AI review requested due to automatic review settings February 19, 2026 20:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the client-side MCP Apps “sampling” plumbing in the desktop UI host (McpAppRenderer) that was inadvertently reverted, so MCP Apps can again issue sampling/createMessage requests via the postMessage bridge and have them fulfilled by goose-server.

Changes:

  • Re-adds the onFallbackRequest hook to handle sampling/createMessage JSON-RPC requests from the iframe.
  • Re-introduces host-side initialization for apiHost and secretKey needed to call the sampling REST endpoint.
  • Restores the required SDK/type imports for the fallback request handler.

@aharvard aharvard requested a review from alexhancock February 19, 2026 20:39
@aharvard aharvard added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit f6f0c6e Feb 19, 2026
24 checks passed
@aharvard aharvard deleted the fix/restore-mcp-app-sampling branch February 19, 2026 21:04
michaelneale added a commit that referenced this pull request Feb 19, 2026
* main: (46 commits)
  chore(deps): bump hono from 4.11.9 to 4.12.0 in /ui/desktop (#7369)
  Include 3rd-party license copy for JavaScript/CSS minified files (#7352)
  docs for reasoning env var (#7367)
  docs: update skills detail page to reference Goose Summon extension (#7350)
  fix(apps): restore MCP app sampling support reverted by #6933 (#7366)
  feat: TUI client of goose-acp (#7362)
  docs: agent variable (#7365)
  docs: pass env vars to shell (#7361)
  docs: update sandbox topic (#7336)
  feat: add local inference provider with llama.cpp backend and HuggingFace model management (#6933)
  Docs: claude code uses stream-json (#7358)
  Improve link confirmation modal (#7333)
  fix(ci): deflake smoke tests for Google models (#7344)
  feat: add Cerebras provider support (#7339)
  fix: skip whitespace-only text blocks in Anthropic message (#7343)
  fix(goose-acp): heap allocations (#7322)
  Remove trailing space from links (#7156)
  fix: detect low balance and prompt for top up (#7166)
  feat(apps): add support for MCP apps to sample (#7039)
  Typescript SDK for ACP extension methods (#7319)
  ...
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.

2 participants

Comments