fix(code-mode): fail closed for unannotated MCP tools - #373
Open
MTEnt wants to merge 1 commit into
Open
Conversation
MTEnt
marked this pull request as ready for review
August 20, 2026 08:00
MTEnt
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
August 20, 2026 08:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #318.
Code Mode previously treated MCP tools without annotations as non-destructive, which allowed them to bypass the approval path. It also read only the camelCase annotation attributes exposed by MCP Python SDK 1.29, which raises on the snake_case attributes used by MCP Python SDK 2.0.
This change follows the MCP ToolAnnotations defaults: tools are treated as destructive unless they explicitly declare read-only behavior or
destructiveHint: false. Both SDK attribute casings are supported.Changes
@truefoundry/trueforge-coreand@truefoundry/trueforge.How was this tested?
pnpm --filter @truefoundry/trueforge-core test --runTestsByPath tests/core/sandbox/scripts/mcpClientPolicy.test.ts --runInBandpnpm --filter @truefoundry/trueforge test --runTestsByPath tests/unit/sandbox/local/scripts/mcpClientPolicy.test.ts --runInBandmcp==1.29.0andmcp==2.0.0model objects.read_wiki_structurebeforetools/callwas dispatched (remoteToolCalls=0).pnpm test(clean Ubuntu clone, Node.js 22.23.2, commit60850ef)pnpm typecheckpnpm lint:cipnpm format:checkpnpm buildChecklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changed — not applicableNote
Cursor Bugbot is generating a summary for commit 60850ef. Configure here.