Skip to content

Bug Report: API Error 400 when tool "read_file" sends binary audio/video data #16741

@PIKADILLY

Description

@PIKADILLY

What happened?

"I am experiencing a persistent API Error 400 when using Gemini CLI (v0.23.0) on Windows 11.
The issue: When the agent uses ffmpeg to generate a clip (MP3, OGG or MP4) and then attempts to analyze it using the read_file tool, the request fails.
Error Message: Unable to submit request because the mime_type: audio/mpeg (or audio/ogg / video/text/timestamp) is not supported in function_response.parts.
Impact: This creates an infinite error loop in the session. I had to manually edit the chats/*.json files to remove the binary data blocks to make the CLI operational again. It seems the CLI is trying to send raw binary data through a protocol part that doesn't support it."

What did you expect to happen?

"I expected the agent to successfully analyze the clip generated by FFmpeg. Specifically, after the 'Shell' tool created the .ogg or .mp4 file, I expected the 'read_file' tool to pass the file content to the Gemini 3 model for transcription and analysis. Instead of the 400 error, the model should have been able to 'hear' the audio and provide the text."

Client information

  • CLI Version: 0.24.0
  • Git Commit: 48ee9bb
  • Session ID: 2a6e85c7-be4a-4d1a-b8be-d3f9c1bf8fc6
  • Operating System: win32 v24.12.0
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Memory Usage: 486.1 MB
  • Terminal Name: Unknown
  • Terminal Background: #ffffff
  • Kitty Keyboard Protocol: Unsupported

Login information

"Personal Google Account authenticated via the standard browser login process (OAuth - personal)."

Anything else we need to know?

"Critical Note: Once the 'API Error 400' occurs, the session enters an infinite loop. Every subsequent prompt triggers the same error because the CLI tries to send the entire history (including the problematic binary data) back to the API.
I had to manually edit the session's JSON file in the ~/.gemini/tmp/ directory to delete the toolCalls and functionResponse blocks containing the binary data just to make the CLI usable again.
It seems the read_file tool is trying to send binary data through function_response.parts, which is not supported by the current Vertex AI / Google AI API protocol for function calling. The CLI should probably use the File API (upload) for these types of files instead of embedding them in the response parts."

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions