Conversation
🤖 Generated with Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73cd76babc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Test Failure AnalysisSummary: The Root Cause: In Suggested Solution: In
from fastmcp.utilities.versions import VersionSpec
# Before
result = await ctx.fastmcp.call_tool(
tool.name, merged, version=tool.version
)
# After
result = await ctx.fastmcp.call_tool(
tool.name, merged, version=VersionSpec(eq=tool.version) if tool.version is not None else None
)Detailed AnalysisFailed step: Log excerpt:
async def call_tool(
self,
name: str,
arguments: dict[str, Any] | None = None,
*,
version: VersionSpec | None = None, # <-- expects VersionSpec, not str
run_middleware: bool = True,
task_meta: None = None,
) -> ...
@dataclass
class VersionSpec:
gte: str | None = None
lt: str | None = None
eq: str | None = None # exact version matchThe Related Files
🤖 Automated triage via Claude Code · edited to reflect latest analysis |
🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Closes #3296
Summary
Adds
CodeMode, an experimental transform inspired by Cloudflare's Code Mode that collapses a large tool surface into two meta-tools:search(inspect tool metadata via Python) andexecute(chaincall_tool(...)invocations in Python). Useful when LLMs need to plan multi-step workflows against many tools without listing them all in context.Changes
fastmcp.experimental.transforms.CodeModetransform with pluggableSandboxProviderprotocolMontySandboxProviderbacked bypydantic-monty(newfastmcp[monty]optional dep)docs/servers/transforms/code-mode.mdxDesign notes
Placed under
fastmcp.experimental.transformssince this is an experimental API. The sandbox provider is a protocol so third-party runtimes (remote sandboxes, WASM, etc.) can plug in without changes to the transform itself.