Skip to content

fix(codex): recover app-server text without completion - #58433

Closed
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/codex-app-server-missing-completion
Closed

fix(codex): recover app-server text without completion#58433
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/codex-app-server-missing-completion

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #58432

Summary

  • accept a completed Codex app-server assistant message as the terminal result when the turn deadline arrives without turn/completed
  • keep the existing timeout/interrupt/retire path for turns that never produced assistant text or already reported an error
  • add regression coverage for the missing-completion path

Why

CodexAppServerSession.run_turn() already records completed agentMessage items into result.final_text and projected_messages. If the subprocess omits turn/completed afterward, the previous deadline path still marked the turn as interrupted and timed out, losing the successful completion state.

Proof

  • uv run --extra dev python -m py_compile agent\transports\codex_app_server_session.py tests\agent\transports\test_codex_app_server_session.py
  • $env:TMP='F:\Codex\tmp\pytest-hermes'; $env:TEMP='F:\Codex\tmp\pytest-hermes'; uv run --extra dev pytest tests\agent\transports\test_codex_app_server_session.py -k "final_agent_message_without_turn_completed or deadline_marks_session_for_retirement or post_tool_quiet_watchdog or turn_aborted_marker" -q -> 4 passed, 55 deselected
  • $env:TMP='F:\Codex\tmp\pytest-hermes'; $env:TEMP='F:\Codex\tmp\pytest-hermes'; uv run --extra dev pytest tests\agent\transports\test_codex_app_server_session.py -q -> 59 passed

Duplicate search

Checked open and closed Hermes PRs/issues for codex app-server missing turn completed final response, codex app-server turn completed timeout assistant, turn/completed codex final_text, and turn timed out after codex final_text. Existing matches were older Codex Responses stream issues, not this app-server session completion path.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists labels Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex app-server can time out after completed assistant text

2 participants