Skip to content

fix(codex): persist app-server session turns - #38264

Closed
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-38210-codex-session-persistence
Closed

sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-38210-codex-session-persistence

Conversation

@sweetcornna

Copy link
Copy Markdown
Contributor

Summary

  • persist Codex app-server projected turns through the existing session persistence path
  • pass conversation_history into the Codex runtime so resume/compression skip logic stays aligned
  • add regression coverage proving Codex app-server turns write user, assistant tool-call, tool, and final assistant messages to SessionDB

Root cause

api_mode=codex_app_server returns early from the conversation loop after the Codex transport projects messages into memory. That bypassed the normal _persist_session() call, so desktop resume/session.info reconciled against an empty messages table and dropped the streamed reply.

Closes #38210.

Verification

  • /Users/cornna/project/hermes-agent/.venv/bin/python -m pytest tests/run_agent/test_codex_app_server_integration.py -q
  • /Users/cornna/project/hermes-agent/.venv/bin/python -m pytest tests/run_agent/test_860_dedup.py tests/run_agent/test_compression_persistence.py -q
  • /Users/cornna/project/hermes-agent/.venv/bin/python -m ruff check agent/codex_runtime.py agent/conversation_loop.py run_agent.py tests/run_agent/test_codex_app_server_integration.py
  • git diff --check

@sweetcornna
sweetcornna force-pushed the codex/fix-38210-codex-session-persistence branch from 0cc01bf to 9ec3f22 Compare June 3, 2026 14:39
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have provider/openai OpenAI / Codex Responses API comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Jun 3, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Closely related to (likely duplicate of) PR #38254 — both close #38210 by adding _persist_session() after the codex_app_server turn so completed turns reach the messages table. This PR additionally passes conversation_history into the Codex runtime for resume/compression alignment. Maintainers should pick one. See also #27637 (same path, compression-persistence variant).

@sweetcornna

Copy link
Copy Markdown
Contributor Author

Closing this draft as a duplicate/backup for #38254. #38254 already fixes #38210, is non-draft, and has green checks; keeping both open would split review on the same Codex app-server persistence issue.

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 P3 Low — cosmetic, nice to have 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.

Codex provider (openai-codex) sessions persist 0 messages → desktop view discards the reply after it streams

2 participants