Bug
The Chrome extension agent chat (and /v1/agent API) fails with a 400 Bad Request when using Gemini models with automation enabled.
Error
GenerateContentRequest.tools[0].function_declarations[5].parameters.properties[content].any_of[2].items: missing field
Root Cause
In dist/esm/daemon/agent.js, the artifacts tool definition has:
content: {
description: "Content to store (string or JSON-serializable object)",
type: ["string", "object", "array", "number", "boolean", "null"],
},
Gemini's API internally converts type: [...] arrays into an anyOf schema. The "array" variant (index 2) requires an items field to be valid, but none is provided. This causes the 400 error.
Other providers (OpenAI, Anthropic) are more lenient and accept the union type without items, so this only affects Gemini.
Reproduction
curl -s -X POST "http://127.0.0.1:8787/v1/agent" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"automationEnabled": true,
"messages": [{"role": "user", "content": "Hello"}],
"model": "google/gemini-2.0-flash",
"tools": ["summarize", "navigate", "repl", "ask_user_which_element", "skill", "artifacts"]
}'
Workaround
Change the content property type in the artifacts tool definition to a simple string:
content: {
description: "Content to store (string or JSON-serializable object). For arrays or complex objects, pass as a JSON string.",
type: "string",
},
Environment
- summarize v0.11.1
- Windows 11
- Model:
google/gemini-2.0-flash
- Chrome extension with automation enabled
🤖 Generated with Claude Code
Bug
The Chrome extension agent chat (and
/v1/agentAPI) fails with a 400 Bad Request when using Gemini models with automation enabled.Error
Root Cause
In
dist/esm/daemon/agent.js, theartifactstool definition has:Gemini's API internally converts
type: [...]arrays into ananyOfschema. The"array"variant (index 2) requires anitemsfield to be valid, but none is provided. This causes the 400 error.Other providers (OpenAI, Anthropic) are more lenient and accept the union type without
items, so this only affects Gemini.Reproduction
Workaround
Change the
contentproperty type in theartifactstool definition to a simple string:Environment
google/gemini-2.0-flash🤖 Generated with Claude Code