Skip to content

Fix/model error antigravity - #309

Merged
co-l merged 4 commits into
co-l:developfrom
JamesDAdams:fix/model-error-antigravity
Sep 2, 2026
Merged

Fix/model error antigravity#309
co-l merged 4 commits into
co-l:developfrom
JamesDAdams:fix/model-error-antigravity

Conversation

@JamesDAdams

Copy link
Copy Markdown
Contributor

Summary

Fixes tool parameter schema serialization errors (HTTP 400 Invalid value at 'request.tools[0].function_declarations[...].parameters.properties[...].value' (type.googleapis.com/google.cloud.aiplatform.master.Schema), "object") encountered with Google Cloud Vertex AI, Antigravity, and Gemini models:

  • Tool Schema Sanitizer (src/server/llm/schema-sanitizer.ts):
    • Recursively strips unsupported keywords across providers (additionalProperties, $schema, $id, patternProperties, etc.).
    • Strips null/undefined fields (e.g. default: null generated by MCP servers such as Jira).
    • Automatically aliases tool parameters named "properties" to "props" in the schema (and remaps them on execution) to prevent collisions with the Protobuf Schema.properties field in Google APIs.
    • Ensures every type: "object" has a defined properties: {} map and every type: "array" has a typed items schema.
  • Tool Adapter & Client Hooking:
    • Integrated sanitizeToolSchema across standard LLM client conversion (client-pure.ts), transport adapters (transport-client.ts), and MCP server tool registration (tool-adapter.ts, manager.ts).
  • Built-in Tool Definitions:
    • Fixed ask_user options union and project_tasks attachments items schemas to conform to strict provider requirements.

AI-Enhanced Development

Tell what models helped shape this PR:

  • AI Models: Gemini 3.7 Flash

Cache Impact

Does this PR affect anything cached — system prompts, tool definitions, skills, or other context?

  • Yes
    • Tool definition parameter schemas for built-in tools (ask_user, project_tasks) and MCP tools are now normalized and sanitized (stripping additionalProperties, null defaults, and renaming "properties" parameter to "props"), which updates the cached tool definitions hash.

@co-l
co-l force-pushed the fix/model-error-antigravity branch from a306365 to cd496a2 Compare September 2, 2026 18:36
@co-l
co-l merged commit eee0ab7 into co-l:develop Sep 2, 2026
6 checks passed
@co-l

co-l commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Merged, will be released in v2.0.136

AI-summary

  • Reviewed the schema sanitizer and fixed a bug in the MCP execution remap: when a properties parameter is renamed to props in the LLM-facing schema, the remap left a stray props argument on the call to the MCP server (strict servers would reject it). Added a regression test covering the rename → remap round-trip
  • Rebased the PR onto latest develop (3 commits, no conflicts), fixed a Prettier formatting issue in schema-sanitizer.ts
  • Verified the full unit suite (5120 passed), typecheck, lint, format and duplicate clean, plus provider e2e green
  • Pushed the branch to the contributor's fork so the PR merges cleanly
  • Squash-merged

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.

2 participants