Files
kandev/apps
jcfs bb7cb66bd9 fix(codex): resolve deadlock in adapter by not holding mutex during RPC calls
The LoadSession, NewSession, Cancel, and Prompt methods were holding
a.mu.Lock() while waiting for client.Call() to return. The codex client's
readLoop processes incoming messages synchronously, and when codex sends
notifications (like mcp_startup_complete), handleNotification tries to
acquire a.mu.RLock() - which blocks because the exclusive lock is held.
This prevents readLoop from processing the RPC response, causing deadlock.

Fix: Don't hold the mutex while waiting for RPC calls. Instead:
1. Acquire lock briefly to read client and needed fields
2. Release lock before RPC call
3. Acquire lock briefly to write results after call completes

Also reverts codex-agent SessionConfig to ResumeViaACP: true since
thread/resume works correctly when not deadlocked.
2026-01-16 02:39:05 +00:00
..
2026-01-14 03:09:59 +00:00
2026-01-16 01:59:00 +00:00