Skip to content

Bug: CLI incorrectly treats .adp files as binary audio (MIME-type mismatch) #16888

@diplfranzhoepfinger

Description

@diplfranzhoepfinger

What happened?

Description
I am using the gemini-cli with 4diac files. The file extension .adp refers to "Adapter Type" definitions, which are plain XML text files. https://github.com/eclipse-4diac/4diac-ide/blob/release/data/typelibrary/events-3.0.0/typelib/ATimeOut.adp
However, the CLI seems to automatically detect .adp as an audio format (likely Active Streaming Format) and attempts to treat it as binary.

Steps to Reproduce

  1. Have a text-based file named test.adp in the directory (valid XML content).
  2. Run gemini and ask a question about this file.
  3. The process fails with an API error.

Observed Output
The API returns a 400 INVALID_ARGUMENT error.
Debug logs show the request fails because the CLI is likely streaming binary data (or declaring an audio mime-type) to an endpoint expecting text.

Workaround
Renaming the file from .adp to .xml fixes the issue immediately, and Gemini can read the file correctly.

Suggested Fix
Please update the mime-type detection to treat .adp as text/xml or allow a mechanism to override mime-type detection for specific extensions.

What did you expect to happen?

I expected the CLI to recognize the .adp file as text/XML (since it contains plain XML content) and process it normally, instead of treating it as binary audio and failing with an error.

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
│ About Gemini CLI                                                                                                     │
│                                                                                                                      │
│ CLI Version                              0.24.0                                                                      │
│ Git Commit                               48ee9bb30                                                                   │
│ Model                                    auto-gemini-3                                                               │
│ Sandbox                                  no sandbox                                                                  │
│ OS                                       win32                                                                       │
│ Auth Method                              OAuth                                                                       │
│ User Email                               <mine>   

Login information

Google Account

Anything else we need to know?

Context:
The .adp files are standard XML files used in Eclipse 4diac (Industrial Automation) to define "Adapter Types". They are not audio files.

Debug Info:
The API consistently returns a 400 INVALID_ARGUMENT error, indicating a mismatch between the sent content type (likely binary/audio) and the actual content needed by the model.

Error Snippet:

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT"
  }
}

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/p2Important but can be addressed in a future release.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions