openai / openai/codex

Codex CLI rejects DOCX attachments with unknown file variant

Open
#44,949 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app-server bug CLI windows-os
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
  1. Open a Codex CLI chat on Windows.
  2. Attach a Microsoft Word .docx document.
  3. Add a short message such as Here's the doc.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.