Codex CLI rejects DOCX attachments with unknown file variant
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex is running?
codex-cli 0.152.1
What operating system are you using?
Windows
What happened?
Attaching a .docx file in the Codex CLI chat fails before the message is sent. The UI displays the staged upload path, then returns:
Invalid request: unknown variant `file`, expected one of `text`, `image`, `localImage`, `audio`, `localAudio`, `skill`, `mention`
The upload was attempted twice and failed identically both times. Image attachments work, and pasting the document content as plain text works.
Steps to reproduce
- Open a Codex CLI chat on Windows.
- Attach a Microsoft Word
.docxdocument. - Add a short message such as
Here's the doc. - Send the message.
Expected behavior
The document should be attached and made available to the conversation. If .docx attachments are unsupported, the client should reject the selection locally with a clear supported-file-types message rather than serializing an unsupported file content variant.
Additional context
The error suggests the client emits a generic file content item while the receiving request schema does not accept that variant.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Codex CLI serializes attachments into the chat request, focusing on the generic file content variant reported by the error. Reproduce the failure with a .docx on Windows and compare it with image and pasted-text attachments. Done means DOCX is supported by the receiving schema or rejected locally with a clear supported-file-types message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100