Skip to content

fix(core): isolate invalid tool registrations - #45325

Merged
rekram1-node merged 2 commits into
v2from
isolate-tool-errors
Aug 26, 2026
Merged

fix(core): isolate invalid tool registrations#45325
rekram1-node merged 2 commits into
v2from
isolate-tool-errors

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

What changes

Tool registration now skips and logs invalid entries instead of failing the entire batch. Healthy tools in the same batch are still installed.

MCP tools

Before: All discovered MCP tools in a Location were submitted in one registration batch. One invalid tool or namespace rejected the entire batch, including healthy tools from unrelated servers. On initial registration, the session could proceed without those MCP tools. On later updates, the previous tool set remained, but the registration error terminated the catalog-update listener, so subsequent updates were no longer processed. The MCP servers could still appear connected.

After: Invalid entries are excluded and healthy tools from the same and other servers register successfully. Validation errors no longer terminate reconciliation, so later catalog updates continue to work and corrected tools can become available. The existing all-server batch structure is unchanged.

Plugin tools

Before: An invalid entry rejected the entire tool-registration batch. The plugin host converted that registration error into a defect. If it occurred during plugin setup, setup failed, the plugin scope was cleaned up, and the plugin was marked failed. This could remove its other tools and registrations too.

After: Invalid entries are skipped, healthy tools register, and plugin setup continues. A tool validation error alone no longer marks the plugin failed or cleans up its other registrations. Unexpected setup failures still behave as before.

Validation and reporting

  • Existing name, namespace, reserved-name, and definition checks remain in place.
  • All otherwise-valid entries sharing a normalized name within the incoming batch are skipped, rather than choosing a winner. Unrelated entries still register.
  • Each rejected entry is logged at error level with its original tool name, namespace, and validation message.
  • RegistrationError remains an internal validation error, but is handled inside Tool.transform(). The batch operation no longer returns it to callers, and the MCP/plugin adapters no longer need Effect.orDie for it.
  • There is no new errored-tool state, server event, API result, or client UI. Logs are currently the only rejection report. MCP instructions are unchanged.

Verification

132 targeted tests passed, covering healthy siblings, rejection logs, collisions, scoped cleanup, MCP catalog updates and recovery, and continued plugin initialization. Core and SDK typechecks and formatting checks passed.

Follow-up to #45317.

@rekram1-node
rekram1-node merged commit 8b6a245 into v2 Aug 26, 2026
8 of 10 checks passed
@rekram1-node
rekram1-node deleted the isolate-tool-errors branch August 26, 2026 18:49
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.

1 participant