Codex App Server 0.145.0: tool-enabled turns never emit turn/completed after all tool results are finalized

Open
#35,810 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python, rust

Research direction

Start with the sanitized reproducer codex-0145-tool-loop-minimal.py and reproduce the App Server 0.145.0 tool-enabled turn over stdio. Trace the App Server lifecycle and tool-loop handling after the final accepted tool result; done means the server emits turn/completed without waiting for the 420-second timeout, while preserving the successful final output and artifact.

Written by the indexing model from the issue text.

Description

app-server bug CLI tool-calls
What version of Codex CLI is running?

0.145.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.6-sol

What platform is your computer?

Ubuntu 24.04.4 LTS, x86_64 (Hetzner VPS)

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

Terminal.app on macOS via SSH to the Ubuntu VPS; Codex App Server uses stdio transport.

Codex doctor report

What issue are you seeing?

Codex App Server 0.145.0 systematically fails to emit turn/completed for tool-enabled turns.

Across 10 reproduced tool-enabled runs, Codex successfully performed the requested work, all tool requests received matching accepted results, the final assistant output was observed, and the expected task artifact was created and valid.

However, turn/completed was never emitted. The client remained waiting until the 420-second turn timeout.

Observed in all affected runs:

  • Tool requests/results fully matched
  • Outstanding tool requests: 0
  • Outstanding server requests: 0
  • Outstanding approvals: 0
  • Outstanding protocol items: 0
  • Final assistant output observed: yes
  • Valid output artifact produced: yes
  • turn/completed observed: no

We also ran a matched test changing only the thread mode:

  • ephemeral=true: affected
  • ephemeral=false: affected

Two previously successful no-tool/minimal App Server control runs did emit turn/completed.

This appears to be a systematic tool-enabled turn completion/lifecycle issue rather than a model-quality failure.

What steps can reproduce the bug?
  1. Start Codex App Server 0.145.0 over stdio.

  2. Create a thread and start a tool-enabled turn using gpt-5.6-sol.

  3. Let the model perform normal workspace operations such as file reads/writes and shell/test commands.

  4. For every tool request, return the corresponding valid tool result to App Server.

  5. Continue processing events until:

    • all tool requests have matching accepted results,
    • there are no outstanding tool/server/approval requests,
    • the final assistant output is received,
    • the requested output artifact has been created successfully.
  6. Continue waiting for the normal terminal lifecycle event:
    turn/completed

Expected:
turn/completed is emitted after the tool-enabled turn has fully finished.

Actual:
turn/completed is never emitted. The client remains waiting until the configured 420-second timeout.

We reproduced this across 10 tool-enabled runs.

A controlled test changing only the thread mode produced the same result:

  • ephemeral=true → no turn/completed
  • ephemeral=false → no turn/completed

A sanitized minimal reproduction is available in:
codex-0145-tool-loop-minimal.py

What is the expected behavior?

After all tool requests have received matching results and no protocol obligations remain, the tool-enabled turn should complete normally and Codex App Server should emit:

turn/completed

The client should not remain blocked waiting until timeout once:

  • all tool items are finalized,
  • the final assistant output has been produced,
  • and no further client action is required.
Additional information

Additional evidence from our controlled investigation:

  • Affected tool-enabled runs: 10
  • Successful no-tool control runs: 2
  • Tool request/result matching: proven
  • Outstanding protocol obligations at terminal state: 0
  • Final assistant output observed: yes
  • Valid task artifact produced before timeout: yes
  • turn/completed absent: reproduced systematically
  • Same behavior with both ephemeral=true and ephemeral=false

Environment:

  • Ubuntu 24.04.4 LTS, x86_64
  • Codex CLI / App Server 0.145.0
  • Model: gpt-5.6-sol
  • App Server transport: stdio
  • Turn timeout used for observation: 420 seconds

The client does not appear to owe any additional protocol action when the stall occurs: all observed tool results have been accepted and no outstanding tool, server, approval, or protocol items remain.

We have prepared sanitized supporting evidence and a minimal pseudocode reproducer. No credentials, authentication tokens, private reasoning content, or user data are included.

Defect classification from our investigation:
SYSTEMATIC_TOOL_ENABLED_TURN_COMPLETION_FAILURE

Suspected component:
Codex App Server 0.145.0 lifecycle/tool-loop handling.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

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.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.