Codex Desktop auto-compaction sends unsupported `context_compaction` item type

Resolved 💬 4 comments Opened Jun 8, 2026 by kiselev27 Closed Jun 11, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.137.0

What subscription do you have?

ChatGPT Pro

Which model were you using?

gpt-5.5

What platform is your computer?

Linux 6.8.0-124-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

_No response_

Codex doctor report

Codex Desktop. No tmux/screen/zellij multiplexer in use.

codex doctor reports TERM=dumb in the internal execution environment:
TERM=dumb
stdin/stdout/stderr are not terminal

What issue are you seeing?

When working in Codex Desktop, automatic context compaction can break the current thread with an API validation error.

The error says that an input item has type context_compaction, but the API schema only accepts compaction and compaction_trigger among compaction-related item types.

Full error:

[ItemParam] [input[733]] [invalid_enum_value] Invalid value: 'context_compaction'. Supported values are: 'additional_tools', 'apply_patch_call', 'apply_patch_call_output', 'code_interpreter_call', 'compaction', 'compaction_trigger', 'computer_call', 'computer_call_output', 'custom_tool_call', 'custom_tool_call_output', 'file_search_call', 'function_call', 'function_call_output', 'image_generation_call', 'item_reference', 'local_shell_call', 'local_shell_call_output', 'mcp_approval_request', 'mcp_approval_response', 'mcp_call', 'mcp_list_tools', 'message', 'reasoning', 'shell_call', 'shell_call_output', 'tool_search_call', 'tool_search_output', and 'web_search_call'.

### What steps can reproduce the bug?


**What steps can reproduce the bug?**

```markdown
1. Open a long-running thread in Codex Desktop.
2. Continue working until automatic context compaction is triggered.
3. After compaction, continue sending messages in the same thread.
4. The thread fails with the `invalid_enum_value` error for `context_compaction`.

### What is the expected behavior?

Codex should serialize compaction-related items using a supported item type such as `compaction` or `compaction_trigger`, or handle compaction metadata internally without sending unsupported item types to the API.

The thread should remain usable after automatic context compaction.

### Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #26573
  • #26493

Powered by Codex Action

kongathr · 2 months ago

Same failure here in Codex Desktop on Linux.

Environment:

  • Codex CLI before update: codex-cli 0.130.0
  • Codex CLI after official installer update: codex-cli 0.137.0
  • Platform: Ubuntu 24.04 / Linux 6.17 x86_64
  • Model observed in Codex CLI UI: gpt-5.5 xhigh
  • Surface: Codex Desktop

Error from the affected thread after automatic context compaction:

[ItemParam] [input[3]] [invalid_enum_value] Invalid value: 'context_compaction'. Supported values are: ... 'compaction', 'compaction_trigger', ...

The same thread later showed the same failure at a much later input index:

[ItemParam] [input[552]] [invalid_enum_value] Invalid value: 'context_compaction'. Supported values are: ... 'compaction', 'compaction_trigger', ...

Observed behavior:

  1. Work in a long-running Codex Desktop thread until automatic context compaction happens.
  2. The UI inserts "Context automatically compacted".
  3. Continuing the same thread fails with the API validation error above.
  4. The thread appears effectively unusable after that point.

Additional diagnostic note: codex doctor did not produce a usable report from the Codex Desktop exec environment. Before updating it refused because TERM=dumb and stdin/stderr were not a TTY; after updating to 0.137.0 it returned no useful output in the same non-TTY shell.

Workaround so far: start a fresh thread from a summary before/after compaction; the affected thread itself remains stuck.

jeremybanka · 2 months ago

Same problem here. Compaction, ironically, now seems to always fail and effectively locks threads once it has.

Feedback ID: 019eadd6-cc5c-7cc1-8e8b-a8815228f49b

kiselev27 · 2 months ago

<img width="3420" height="1978" alt="Image" src="https://github.com/user-attachments/assets/17c911fd-d7e2-4187-a1f3-5ef2362f450f" />

This solves the problem! Hooray!

@jeremybanka @kongathr @fcoury @genki