Codex Desktop session replay is poisoned after compaction emits malformed tool_search_call arguments

Resolved 💬 2 comments Opened May 1, 2026 by ramarnat Closed May 1, 2026

Codex Desktop bug report draft

Title

Codex Desktop session replay is poisoned after compaction emits malformed tool_search_call arguments

What version of the Codex App are you using?

Codex Desktop 26.429.20946, build 2312

What subscription do you have?

Unknown from local diagnostics

Platform

macOS 26.3.1, arm64

What issue are you seeing?

After a long session and context compaction, Codex Desktop wrote a malformed tool call into the session transcript. The malformed item then poisoned session replay. Every later retry of that same session failed before the assistant could answer.

The failing API validation looked like this after redaction:

invalid_request_error
[ObjectParam] [input[184].arguments.<redacted_1582_char_property_name>]
[property_name_above_max_length]
Invalid property name in 'input[184].arguments': '<redacted>' is too long.
Expected a string with maximum length 256, but got a string with length 1582 instead.
status: 400

The corrupt transcript record was a response_item with payload type tool_search_call. The arguments object had a single random-looking 1582-character property name and no query field. The local tool parser also logged:

failed to parse tool_search arguments: missing field `query`

Expected shape for that tool call would have included a normal query string. Instead the key itself became a long junk string.

Steps that reproduced it

  1. Work in Codex Desktop in a long-running session.
  2. Run enough inspection/tool output for context compaction to happen.
  3. Immediately after context_compacted, the session transcript records a malformed tool_search_call.
  4. Continue/retry the session.
  5. The API rejects replayed history with property_name_above_max_length on input[184].arguments.

Expected behavior

Codex should never persist an invalid tool call into session history. If structured tool-call arguments fail schema validation, the invalid assistant item should be dropped or repaired before it can poison future session replay.

Actual behavior

The invalid tool_search_call was persisted. Replaying the session kept resending it and made the session unusable until the malformed JSONL records were manually removed.

Sanitized transcript sequence

response_item: function_call_output, large shell output (~34k tokens)
compacted
turn_context
context_compacted
response_item: tool_search_call, call_id=<redacted>, arguments={<redacted_1582_char_key>: 780}
response_item: function_call_output, output="failed to parse tool_search arguments: missing field `query`"
later event_msg: invalid_request_error property_name_above_max_length for input[184].arguments.<redacted>

Additional information

The random-looking string was not present in repo files and was not present earlier in the session transcript except in the malformed tool call and later API error echoes. This points to a compaction/tool-call serialization or structured-output generation failure, not project code.

Labels that seem applicable: app, bug, tool-calls, context.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗