Skip to content

Fix contributed tool compatibility - #8

Open
ruibaby wants to merge 1 commit into
mainfrom
fix/contributed-tool-compatibility
Open

Fix contributed tool compatibility#8
ruibaby wants to merge 1 commit into
mainfrom
fix/contributed-tool-compatibility

Conversation

@ruibaby

@ruibaby ruibaby commented Aug 31, 2026

Copy link
Copy Markdown
Member

What

  • Accept contributed tool providers loaded from a plugin's real development directory while retaining exact ownership checks for packaged plugins.
  • Add JSON text content when a contributed provider returns only structured content.
  • Preserve the original structured content for clients that support it.
  • Add coverage for development-mode provider ownership, neighboring-directory rejection, and JSON text fallback.

Reproduction

  1. Load a contributed MCP tool provider from a Halo plugin in development mode.
  2. The provider is rejected because its class location is nested below the plugin load directory.
  3. Call a contributed tool that returns only structured content from a client without structured-content support.
  4. The client displays no output even though the tool call succeeded.

Validation

  • Ran ./gradlew check --no-daemon.
  • Verified a development-mode Docsme provider with eleven contributed tools on Halo 2.26.
  • Called plugin-docsme/list-projects through the MCP endpoint and confirmed that JSON text and structured content both contain the same four projects.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T09:25:43.383092Z 183e977 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 183e9776c6

ℹ️ 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".

Comment on lines +230 to +231
var pluginPath = Path.of(normalizedPlugin).toRealPath();
var providerPath = Path.of(normalizedProvider).toRealPath();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Offload real-path resolution from the reactive request thread

When a contributed provider's URI is nested rather than exactly equal, toRealPath() performs synchronous filesystem I/O for both paths. The WebFlux tools/list and tools/call flows reach this predicate without a scheduler boundary, and registeredTools() deliberately repeats discovery for every request, so a slow or network-backed plugin filesystem can block the event-loop thread and stall unrelated MCP requests. Resolve these paths ahead of request handling or offload the operation to a bounded-elastic scheduler.

AGENTS.md reference: AGENTS.md:L26-L30

Useful? React with 👍 / 👎.

Comment on lines +269 to +270
if (textContent == null && result.structuredContent() != null) {
textContent = JsonMapper.shared().writeValueAsString(result.structuredContent());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require text in the current result contract instead of falling back

When a provider omits textContent, this branch silently preserves that incomplete result shape by synthesizing text at the transport boundary. The repository is unreleased and explicitly prohibits compatibility and fallback branches, so the current McpToolResult contract and its providers should instead be changed directly to construct or require the desired text representation; otherwise the obsolete one-argument result form remains supported indefinitely.

AGENTS.md reference: AGENTS.md:L32-L32

Useful? React with 👍 / 👎.

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