Skip to content

Gemini Provider: HTTP 400 error on tool result submission (INVALID_ARGUMENT) #648

Closed

Description

@mar627

Provider: Google Gemini (AI Studio Key)
Models Tested: gemini-3.1-flash-lite, gemini-3-flash-preview, gemini-3.7-flash

Agent commands using the Gemini provider successfully execute local system actions (e.g., screenshot, write_file, run_shell), but fail immediately after with a Gemini request failed with HTTP 400 error badge.

Steps to Reproduce:
1. Connect a valid API Key from Google AI Studio.
2. Select any Gemini Flash model (e.g., gemini-3.1-flash-lite or gemini-3.7-flash).
3. Run an agent command that triggers a tool action (e.g., "Take a screenshot" or "Create a text file on desktop").
4. Observe that the file/action completes on macOS (toolResultOK: true), but the UI returns an HTTP 400 error during the follow-up thinking phase.

agent-history.json
{"toolResultContent":"wrote 239 bytes to /Users/.../Desktop/happy days.txt","toolResultOK":true,"toolName":"write_file","kind":"toolResult"}, {"state":"thinking","kind":"stateChanged"}, {"errorMessage":"Gemini request failed with HTTP 400.","kind":"error"}

The agent should parse the toolResultContent back to Google's API using the correct Gemini functionResponse schema so the model can return a final completion summary instead of throwing an HTTP 400 INVALID_ARGUMENT error.

Activity

  1. mar627 commented on Aug 30, 2026

    @mar627
    Author

    relocating to v2 releases repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions