fix(codex): seed app-server sessions with configured cwd

This commit is contained in:
JP Lew 2026-06-04 12:06:40 +05:30 committed by Teknium
parent 745c4db235
commit c11ae8261b
4 changed files with 84 additions and 1 deletions

View file

@ -250,7 +250,9 @@ def run_codex_app_server_turn(
# Spawned on first turn, reused across turns, closed at AIAgent
# shutdown (see _cleanup hook).
if not hasattr(agent, "_codex_session") or agent._codex_session is None:
cwd = getattr(agent, "session_cwd", None) or os.getcwd()
from agent.runtime_cwd import resolve_agent_cwd
cwd = getattr(agent, "session_cwd", None) or str(resolve_agent_cwd())
# Approval callback: defer to Hermes' standard prompt flow if a
# CLI thread has installed one. Gateway / cron contexts get the
# codex-side fail-closed default.