OpenAI Codex Remote Control: Fix "Awaiting Approval" Hangs & Pairing Bugs
OpenAI Codex and its terminal agent wrappers allow developers to run multi-step code generation, automated refactors, and test suites directly from their command line. Remote pairing features let you walk away from your desk while the agent writes code.
However, two infuriating bugs plague developers using remote Codex sessions: the infamous “Awaiting approval” mobile freeze (where the agent waits for a confirmation that never appears on your phone) and the stuck pairing QR code caused by SQLite database locks.
Here is a technical diagnosis of why these bugs happen, how to resolve them immediately on macOS, and how to get an uninterrupted mobile terminal experience.
| Issue | What Happens | Resolution |
|---|---|---|
| Mobile “Thinking...” Freeze | Desktop terminal asks for approval, but mobile UI hides the prompt | Run non-interactive flag or use native Mac PTY stream |
| QR Pairing Hangs Indefinitely | SQLite Write-Ahead Log lock (state_5.sqlite-wal) | Clear orphaned processes and reset WAL files |
Bug 1: The “Awaiting Approval” Ghost Prompt on Mobile
When Codex prompts for permission to execute a shell script, some command wrappers fail to serialize the interactive TTY prompt into the mobile schema. Because the mobile app only renders recognized event types, the approval prompt never appears on your phone. The agent pauses indefinitely waiting for host input.
Workaround inside Codex CLI:
codex --auto-approve-commands --dangerously-skip-permissionsCaution: Skipping permission prompts means the AI agent can run arbitrary shell commands and delete files without human confirmation.
Bug 2: SQLite WAL Lock Freezing QR Code Pairing
Codex maintains local session state in an embedded SQLite database (~/.codex/state_5.sqlite). When a previous session crashes, SQLite enters a Write-Ahead Logging (WAL) deadlock.
How to clear the lock on macOS:
pkill -9 -f codex rm -f ~/.codex/*.sqlite-wal ~/.codex/*.sqlite-shmThe Clean Fix: Stream the Actual Terminal via Macky
With Macky, you stream your Mac's raw interactive terminal directly to your iPhone via WebRTC.
- Zero Ghost Prompts: Every prompt, confirmation, and diff appears verbatim in real time.
- One-Tap Approvals: Tap
yandEnteron Macky's custom mobile accessory toolbar. - True Background Continuity: Sleep your phone or switch networks without dropping agent processes.
Related Guides & Comparisons
Try Macky
Connect to your Mac terminal from your iPhone. Free to start, no configuration required.