inspector/core/mcp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Cliff Hall 3220d6239a
fix(web): send a cancellation notification when cancelling an ordinary tool call (#1458) (#1463)
* fix(web): send a cancellation notification when cancelling an ordinary tool call (#1458)

The Tool detail panel's Cancel button was a silent no-op for ordinary
(non-task) tool calls: App.onCancelToolCall found no captured taskId and
did nothing, leaving the button looking actionable while the call ran on.

Wire request cancellation through the MCP cancellation flow. callTool now
tracks the in-flight call with an AbortController whose signal is threaded
into the SDK request options; aborting it makes the SDK send a
notifications/cancelled for that request and reject the pending call.
cancelToolCall() performs the abort. callTool surfaces the cancellation as
a ToolCallCancelledError (without recording a failed call), which App
clears as a clean cancel plus a short confirmation toast.

Task-augmented calls are unchanged: they have a server-side task and are
still cancelled via cancelRequestorTask (#1457).

Closes #1458

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(web): address review — distinguish disconnect from cancel; tidy callTool params

Review follow-ups on #1463:

- Disconnect no longer surfaces as "Tool call cancelled". The catch in
  callToolWithRetries now throws ToolCallCancelledError only when the abort
  reason matches the deliberate user-cancel reason (TOOL_CALL_CANCELLED_REASON);
  a disconnect aborts the same controller with a different reason and falls
  through to the normal error path, so no misleading toast.
- Note the activeToolCallAbortController slot is shared (last-writer-wins)
  across all callTool callers.
- Fold callToolWithRetries/attemptToolCall's long positional parameter list into
  a single ToolCallRequest object; move the URL-elicitation loop state into
  callToolWithRetries.

Adds an integration test that a disconnect mid-call rejects as an ordinary
error (not ToolCallCancelledError), using a slow send_progress call over HTTP.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 22:23:02 -04:00
..
__tests__ feat: apply auto-refresh setting live + diff-aware list-changed indicator (#1444) (#1445) 2026-06-09 11:00:28 -04:00
node Revert "First pass at pulling the v1.5 CLI, TUI, and Launcher clients into v2." 2026-06-09 21:56:38 -07:00
remote feat(web): reorderable ServerCards — drag-and-drop + keyboard (#1369) (#1447) 2026-06-09 14:15:58 -04:00
state feat: apply auto-refresh setting live + diff-aware list-changed indicator (#1444) (#1445) 2026-06-09 11:00:28 -04:00
apps.ts feat(apps): add isAppTool helper in core (#1260) (#1272) 2026-05-01 17:03:11 -04:00
config.ts feat(core): port v1.5 InspectorClient + transports + auth subsystem (#1302) (#1306) 2026-05-15 15:36:17 -04:00
elicitationCreateMessage.ts feat(web): URL elicitation — explicit completion step + error-path (-32042) handling (#1415) (#1436) 2026-06-06 18:25:01 -04:00
fetchTracking.ts feat(network): add Network screen surfacing backend fetch log (#1355) (#1363) 2026-05-27 08:35:25 -04:00
index.ts feat(core): port v1.5 InspectorClient + transports + auth subsystem (#1302) (#1306) 2026-05-15 15:36:17 -04:00
inspectorClient.ts fix(web): send a cancellation notification when cancelling an ordinary tool call (#1458) (#1463) 2026-06-13 22:23:02 -04:00
inspectorClientEventTarget.ts feat(web): display negotiated MCP protocol version on ServerCard (#1324) (#1442) 2026-06-08 07:40:02 -04:00
inspectorClientProtocol.ts feat: apply auto-refresh setting live + diff-aware list-changed indicator (#1444) (#1445) 2026-06-09 11:00:28 -04:00
messageTrackingTransport.ts feat(web): display negotiated MCP protocol version on ServerCard (#1324) (#1442) 2026-06-08 07:40:02 -04:00
oauthManager.ts refactor(core): apply v1.5-port cleanups deferred from #1306 (#1316) 2026-05-17 19:15:48 -04:00
samplingCreateMessage.ts refactor(core): apply v1.5-port cleanups deferred from #1306 (#1316) 2026-05-17 19:15:48 -04:00
serverList.ts feat(web): list-changed handling — indicator, pull-on-demand default, and per-server auto-refresh opt-in (#1402) (#1443) 2026-06-08 12:58:21 -04:00
sessionStorage.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00
taskNotificationSchemas.ts Phase 0 foundations for component interfaces refactor 2026-04-15 16:06:23 -04:00
toolCallCancelledError.ts fix(web): send a cancellation notification when cancelling an ordinary tool call (#1458) (#1463) 2026-06-13 22:23:02 -04:00
toolOutputValidation.ts feat(apps): render running MCP Apps end-to-end (#1370) (#1403) 2026-06-01 18:01:44 -04:00
typedEventTarget.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00
types.ts Revert "First pass at pulling the v1.5 CLI, TUI, and Launcher clients into v2." 2026-06-09 21:56:38 -07:00
urlElicitation.ts feat(web): URL elicitation — explicit completion step + error-path (-32042) handling (#1415) (#1436) 2026-06-06 18:25:01 -04:00