CLI bug: Codex repeatedly resubmits the same tool-call result

Open 💬 1 comment Opened Jun 12, 2026 by N0zoM1z0

What version of Codex CLI is running?

Codex CLI 0.137.0

What subscription do you have?

N/A. The reproduction uses a local OpenAI-compatible mock provider and a fake API key.

Which model were you using?

gpt-4 in the local mock-provider replay.

What platform is your computer?

Linux x86_64 in Docker (node:24-bookworm)

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

Non-interactive Docker/CI shell.

Codex doctor report

Not available in this minimal Docker reproduction.

What issue are you seeing?

The provider stream contains a repeated tool-call id. Codex records and resubmits the same edit_1 tool result across retry requests instead of treating it as stale/duplicate state. A side-effect variant of this case executed the shell command once, so this report is limited to duplicated tool-result state rather than claiming repeated filesystem side effects.

What steps can reproduce the bug?

Standalone reproduction

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public upstream package/release source and starts a local mock provider; it does not require this repository or any private fuzzing harness. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/571b56c78b634e0b6c7dc6afb78e331a

The Gist contains codex-duplicate-tool-execution.reproduce.py. Download and run:

gh gist clone 571b56c78b634e0b6c7dc6afb78e331a codex-duplicate-tool-execution-reproducer
cd codex-duplicate-tool-execution-reproducer
python3 codex-duplicate-tool-execution.reproduce.py

To reuse an already-built local image:

python3 codex-duplicate-tool-execution.reproduce.py --skip-build

Key output from a local run against the affected version:

process_exit=1
provider_requests=31
tool_result_counts={'edit_1': 30}
late_stream_events_after_stop=1
duplicate_tool_result edit_1: observed=30 expected>=2
REPRODUCED

What is the expected behavior?

Codex should process each provider tool-call id at most once and should not repeatedly resubmit stale tool results after a duplicated or malformed stream state.

Additional information

No.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗