-
Notifications
You must be signed in to change notification settings - Fork 19
fix(intent): infer operation_type from tool variant instead of requiring it #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
…ing it This fixes #278 where Gemini 3 Pro via Antigravity crashed when generating tool calls with nested JSON objects in the intent parameter. Changes: - Remove operation_type requirement from intent parameter - Infer operation_type automatically from tool variant: - call_tool_read → "read" - call_tool_write → "write" - call_tool_destructive → "destructive" - Make intent parameter optional (empty {} now works) - Update validateIntentForVariant to return (intent, error) and create default intent if nil - Simplify Validate() to only check optional fields (data_sensitivity, reason) - Update tests to reflect new behavior - Update documentation The two-key security model was redundant - the tool variant already declares intent. This simplification enables compatibility with models that have issues generating nested JSON objects. Closes #278 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deploying mcpproxy-docs with
|
| Latest commit: |
5d2a9f9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9f319e5.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-infer-intent-operation-t.mcpproxy-docs.pages.dev |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 21398605626 --repo smart-mcp-proxy/mcpproxy-go
|
Gemini 3 Pro has strict limitations with nested objects in tool schemas: - Maximum 4-level nesting depth - Cannot handle untyped/schema-less objects - Strict schema validation Remove the `intent` object parameter entirely from call_tool_* schemas. The operation_type is already inferred from the tool variant, and the optional audit fields (data_sensitivity, reason) can be added back later if needed via flat string parameters. This should resolve the "improper format stop reason" errors when Gemini tries to generate tool calls. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace nested intent object with flat string parameters to avoid
Gemini 3 Pro's strict limitations with nested JSON objects:
- Replace `intent: { data_sensitivity, reason }` with flat params:
- `intent_data_sensitivity` - optional data classification
- `intent_reason` - optional explanation for audit trail
- Update extractIntent() to read from flat parameters
- operation_type still inferred from tool variant (call_tool_read/write/destructive)
- Activity log features preserved - intent metadata recorded in activity records
- Update tests and documentation
Fixes #278
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The CLI was still building a nested intent object which the server's extractIntent() no longer reads. Updated to use flat intent_data_sensitivity and intent_reason parameters. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "Optional" from descriptions (models skip optional fields) - Change "For audit trail" to "Recommended for compliance/accountability" - Add "Requires intent.operation_type" to main tool descriptions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… fields - Remove operation_type mentions (inferred from tool name) - Make intent_data_sensitivity action-oriented: "Classify data being accessed/modified/deleted" - Make intent_reason a question with examples: "Why is this tool being called?" - Update retrieve_tools: "Always provide intent_reason and intent_data_sensitivity" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
No longer needed since operation_type is inferred from tool variant. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Fixes #278 - Gemini 3 Pro via Antigravity crashes when generating tool calls with nested JSON objects in the intent parameter.
Changes:
operation_typerequirement from intent parameter - now inferred from tool variantintentparameter optional (empty{}now works)data_sensitivity,reason)Before (required):
{ "name": "call_tool_read", "arguments": { "name": "github:list_repos", "args_json": "{}", "intent": { "operation_type": "read" // <-- REQUIRED, caused crash on Gemini 3 } } }After (optional):
{ "name": "call_tool_read", "arguments": { "name": "github:list_repos", "args_json": "{}" // No intent needed! operation_type is inferred from tool variant } }The tool variant already declares the intent (
call_tool_read= read operation), so requiringoperation_typein the intent object was redundant. This simplification enables compatibility with models that have issues generating nested JSON objects.Test plan
go test ./internal/contracts/... ./internal/server/... -run "Intent")🤖 Generated with Claude Code