-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Description
Running with the Google provider fails because tool parameter schemas include JSON Schema 'const'. This triggers either Pydantic validation errors or a Gemini API 400.
To reproduce:
- Run:
uvx fast-agent-mcp go --model google.gemini-2.5-pro --uvx wcgw - Type: hi
Observed errors
-
Pydantic validation (before provider request):
ValidationError: ... properties.*.const ... Extra inputs are not permitted -
Gemini API (after getting past Pydantic):
Google API Error: 400
Invalid JSON payload received. Unknown name "const" at ...parameters...
Environment
- OS: Linux (Fedora) x86_64
- Python: 3.13
- uv: 0.8.23
- fast-agent-mcp: latest via uvx
- Model: google.gemini-2.5-pro
Notes
- Offending places include fields like allowed_globs / allowed_commands that use const: "all".
- google.genai function_declarations don’t accept 'const'; Pydantic may also reject it.
Workaround verified locally
- In src/fast_agent/llm/provider/google/google_converter.py:
- If const is a string, rewrite to enum: [value].
- If const is non-string, drop the constraint to avoid Gemini 400.
- With this, the repro initializes and responds.
Proposal
- Update _clean_schema_for_google to rewrite/remove 'const' as above (and continue stripping other unsupported keys).
evalstate
Metadata
Metadata
Assignees
Labels
No labels