PR #22791 proof audit pass 2 -- independent rerun of R4 (numeric exit 17, mid-turn + idle) using the audited driver bundle (sha256 1f86ff3f...5def, matches). STAND-IN codex app-server (driver/standin-app-server.mjs), real T3 server. Driver copy changed only: log dir -> /tmp/ev-22791/audit2/logs, HOME_DIR -> /tmp/ev-22791/home-audit2[-before] (fresh), server started by hand (pid recorded via $!). settings.json (binaryPath -> codex-standin) copied by hand; the bundle does not create it. AFTER = 1afd783c5e4ee4764ccc24bbe1649d25be539cee BEFORE = ed3f965e0768f9a77729a17c5145a90ff3ab6210 ################ AFTER ################ === side=after-audit2 checkout=/home/ubuntu/wt/pr-22791 HEAD=1afd783c5e4ee4764ccc24bbe1649d25be539cee server_pid=1985271 (STAND-IN codex app-server) === ##### R4 numeric exit(17) mid-turn and idle (after-audit2) ##### thread R4=mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b [wait mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b] after 0.8s: {"threadId":"mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b","runId":"run:thread:mcp%3A80eceff4-dab9-42be-b250-e9a4fc84ed5b:ordinal:1","status":"completed","timedOut":false} app-server pids before: 1985747 [ps] children of server 1985271: PID PPID ELAPSED COMMAND 1985747 1985271 0 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node /tmp/ev-22791/driver/standin-app-server.mjs app-server -- R4a mid-turn: prompt EXIT:17 (stand-in exits 300ms after turn/started) [wait mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b] after 0.3s: {"threadId":"mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b","runId":"run:thread:mcp%3A80eceff4-dab9-42be-b250-e9a4fc84ed5b:ordinal:2","status":"failed","timedOut":false} (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 2 failed started=2026-10-22T13:54:07.326Z completed=2026-10-22T13:54:07.698Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 1 completed started=2026-10-22T13:54:02.326Z completed=2026-10-22T13:54:02.788Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [error item run=2] The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs. [ps] children of server 1985271: PID PPID ELAPSED COMMAND [new server log lines matching keys since mark 112] [13:54:07.698] WARN (#7842): orchestration V2 provider event ingestion failed cause: 'RunExecutionIngestError: Failed while ingesting orchestration V2 run execution run:thread:mcp%3A80eceff4-dab9-42be-b250-e9a4fc84ed5b:ordinal:2.\n' + ' [cause]: ProviderAdapterEventStreamError: Failed while streaming codex provider session provider-session:provider-instance:codex:shared events.\n' + ' [cause]: CodexAppServerProcessExitedError: Codex App Server process exited with code 17\n' + [13:54:07.704] WARN (#7842): orchestration V2 failed to interrupt turn after ingestion failure cause: 'ProviderAdapterInterruptError: Failed to interrupt codex provider turn provider-turn:provider:codex:native-turn:standin-turn-1985747-3.\n' + ' [cause]: CodexAppServerProcessExitedError: Codex App Server process exited with code 17\n' + [provider session projection: status(runtime_error=>error, other release=>stopped) | lastError] provider-session:provider-instance:codex:shared|error|ProviderAdapterEventStreamError: Failed while streaming codex provider session provider-session:provider-instance:codex:shared events. [cause]: CodexAppServerProcessExitedError: Codex App Server process exited with code 17 }|2026-10-22T13:54:07.690Z [log grep R4a] read-process-exit-status=0 ProviderAdapterTurnStartError=0 ProviderAdapterEventStreamError=1 unexpectedly=0 WARN=2 ERROR=0 | trace: writeReleasedSessionEvents=1 runtime_error=0 manual_shutdown=0 idle_timeout=0 server_shutdown=0 EventStreamError=0 read-process-exit-status=0 TurnStartError=0 [wait mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b] after 0.7s: {"threadId":"mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b","runId":"run:thread:mcp%3A80eceff4-dab9-42be-b250-e9a4fc84ed5b:ordinal:3","status":"completed","timedOut":false} (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 3 completed started=2026-10-22T13:54:13.311Z completed=2026-10-22T13:54:13.717Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 2 failed started=2026-10-22T13:54:07.326Z completed=2026-10-22T13:54:07.698Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 1 completed started=2026-10-22T13:54:02.326Z completed=2026-10-22T13:54:02.788Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [error item run=2] The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs. app-server pids now: 1986014 [new server log lines matching keys since mark 156] [provider session projection: status(runtime_error=>error, other release=>stopped) | lastError] provider-session:provider-instance:codex:shared|ready||2026-10-22T13:54:13.227Z [log grep R4a-next] read-process-exit-status=0 ProviderAdapterTurnStartError=0 ProviderAdapterEventStreamError=1 unexpectedly=0 WARN=2 ERROR=0 | trace: writeReleasedSessionEvents=1 runtime_error=0 manual_shutdown=0 idle_timeout=0 server_shutdown=0 EventStreamError=0 read-process-exit-status=0 TurnStartError=0 -- R4b idle: SIGUSR1 to app-server -> stand-in calls process.exit(17) while no turn runs app-server pids before idle exit: 1986014 [ps] children of server 1985271: PID PPID ELAPSED COMMAND [new server log lines matching keys since mark 156] [wait mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b] after 0.5s: {"threadId":"mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b","runId":"run:thread:mcp%3A80eceff4-dab9-42be-b250-e9a4fc84ed5b:ordinal:4","status":"completed","timedOut":false} (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 4 completed started=2026-10-22T13:54:23.071Z completed=2026-10-22T13:54:23.326Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 3 completed started=2026-10-22T13:54:13.311Z completed=2026-10-22T13:54:13.717Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 2 failed started=2026-10-22T13:54:07.326Z completed=2026-10-22T13:54:07.698Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [run] 1 completed started=2026-10-22T13:54:02.326Z completed=2026-10-22T13:54:02.788Z (mcp:80eceff4-dab9-42be-b250-e9a4fc84ed5b) [error item run=2] The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs. app-server pids now: 1986234 [ps] children of server 1985271: PID PPID ELAPSED COMMAND 1986234 1985271 0 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node /tmp/ev-22791/driver/standin-app-server.mjs app-server [new server log lines matching keys since mark 156] [provider session projection: status(runtime_error=>error, other release=>stopped) | lastError] provider-session:provider-instance:codex:shared|ready||2026-10-22T13:54:22.990Z [log grep R4b] read-process-exit-status=0 ProviderAdapterTurnStartError=0 ProviderAdapterEventStreamError=1 unexpectedly=0 WARN=2 ERROR=0 | trace: writeReleasedSessionEvents=2 runtime_error=0 manual_shutdown=0 idle_timeout=0 server_shutdown=0 EventStreamError=0 read-process-exit-status=0 TurnStartError=0 ##### audit2 extra: idle exit(17) status snapshot without a following turn ##### ppid check: 1985271 13:54:42.736853843 kill -USR1 1986234 alive? no children of 1985271: provider-session:provider-instance:codex:shared|error|ProviderAdapterEventStreamError: Failed while streaming codex provider session provider-session:provider-instance:codex:shared events. [cause]: CodexAppServerProcessExitedError: Codex App Server process exited with code 17 }|2026-10-22T13:54:42.748Z 13:54:44.763704179 kill -TERM 1985271 server 1985271 exited after ~2s greps after stop: EventStreamError=1 unexpectedly=0 0 ################ BEFORE (R4b idle only) ################ === side=before-audit2 checkout=/tmp/ev-22791/base HEAD=ed3f965e0768f9a77729a17c5145a90ff3ab6210 server_pid=1986458 (STAND-IN codex app-server) === ##### R4 numeric exit(17) mid-turn and idle (before-audit2) ##### thread R4=mcp:185db541-c319-49fe-a493-69e246d302f2 [wait mcp:185db541-c319-49fe-a493-69e246d302f2] after 0.8s: {"threadId":"mcp:185db541-c319-49fe-a493-69e246d302f2","runId":"run:thread:mcp%3A185db541-c319-49fe-a493-69e246d302f2:ordinal:1","status":"completed","timedOut":false} app-server pids before: [ps] children of server 1986458: PID PPID ELAPSED COMMAND 1986461 1986458 25 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node apps/server/src/bin.ts serve --base-dir /tmp/ev-22791/home-audit2-before --port 38792 --host 127.0.0.1 /tmp/ev-22791/proj -- R4b idle: SIGUSR1 to app-server -> stand-in calls process.exit(17) while no turn runs app-server pids before idle exit: [ps] children of server 1986458: PID PPID ELAPSED COMMAND 1986461 1986458 29 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node apps/server/src/bin.ts serve --base-dir /tmp/ev-22791/home-audit2-before --port 38792 --host 127.0.0.1 /tmp/ev-22791/proj [new server log lines matching keys since mark 112] [wait mcp:185db541-c319-49fe-a493-69e246d302f2] after 0.4s: {"threadId":"mcp:185db541-c319-49fe-a493-69e246d302f2","runId":"run:thread:mcp%3A185db541-c319-49fe-a493-69e246d302f2:ordinal:2","status":"completed","timedOut":false} (mcp:185db541-c319-49fe-a493-69e246d302f2) [run] 2 completed started=2026-10-22T13:55:28.572Z completed=2026-10-22T13:55:28.849Z (mcp:185db541-c319-49fe-a493-69e246d302f2) [run] 1 completed started=2026-10-22T13:55:19.406Z completed=2026-10-22T13:55:19.901Z app-server pids now: [ps] children of server 1986458: PID PPID ELAPSED COMMAND 1986461 1986458 35 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node apps/server/src/bin.ts serve --base-dir /tmp/ev-22791/home-audit2-before --port 38792 --host 127.0.0.1 /tmp/ev-22791/proj [new server log lines matching keys since mark 112] [provider session projection: status(runtime_error=>error, other release=>stopped) | lastError] provider-session:provider-instance:codex:shared|ready||2026-10-22T13:55:19.322Z [log grep R4b] read-process-exit-status=0 ProviderAdapterTurnStartError=0 ProviderAdapterEventStreamError=0 unexpectedly=0 WARN=0 ERROR=0 | trace: writeReleasedSessionEvents=0 runtime_error=0 manual_shutdown=0 idle_timeout=0 server_shutdown=0 EventStreamError=0 read-process-exit-status=0 TurnStartError=0 NOTE (audit2): run above is INVALID - base bin.ts re-execs; server_pid 1986458 is a wrapper, real server is its child 1986461. Rerunning R4b against 1986461. === side=before-audit2 checkout=/tmp/ev-22791/base HEAD=ed3f965e0768f9a77729a17c5145a90ff3ab6210 server_pid=1986461 (STAND-IN codex app-server) === ##### R4 numeric exit(17) mid-turn and idle (before-audit2) ##### thread R4=mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e [wait mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e] after 0.6s: {"threadId":"mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e","runId":"run:thread:mcp%3A886a8a64-bb2d-4ba7-8aff-8b72d9d5386e:ordinal:1","status":"completed","timedOut":false} app-server pids before: 1986927 [ps] children of server 1986461: PID PPID ELAPSED COMMAND 1986927 1986461 31 /home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node /tmp/ev-22791/driver/standin-app-server.mjs app-server -- R4b idle: SIGUSR1 to app-server -> stand-in calls process.exit(17) while no turn runs app-server pids before idle exit: 1986927 [ps] children of server 1986461: PID PPID ELAPSED COMMAND [new server log lines matching keys since mark 112] [wait mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e] after 0.2s: {"threadId":"mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e","runId":"run:thread:mcp%3A886a8a64-bb2d-4ba7-8aff-8b72d9d5386e:ordinal:2","status":"failed","timedOut":false} (mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e) [run] 2 failed started=2026-10-22T13:55:59.608Z completed=2026-10-22T13:55:59.657Z (mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e) [run] 1 completed started=2026-10-22T13:55:50.435Z completed=2026-10-22T13:55:50.915Z (mcp:886a8a64-bb2d-4ba7-8aff-8b72d9d5386e) [error item run=2] The provider could not start this turn. Retry the turn; if it keeps failing, check the provider setup and server logs. app-server pids now: [ps] children of server 1986461: PID PPID ELAPSED COMMAND [new server log lines matching keys since mark 112] [13:55:59.654] ERROR (#8496): orchestration V2 provider turn start failed cause: 'ProviderAdapterTurnStartError: Failed to start run run:thread:mcp%3A886a8a64-bb2d-4ba7-8aff-8b72d9d5386e:ordinal:2 on codex provider thread provider-thread:provider:codex:native-thread:pending%3Arun%3Athread%3Amcp%253A886a8a64-bb2d-4ba7-8aff-8b72d9d5386e%3Aordinal%3A1.\n' + ' [cause]: CodexAppServerProcessExitedError: Codex App Server process exited with code 17\n' + [provider session projection: status(runtime_error=>error, other release=>stopped) | lastError] provider-session:provider-instance:codex:shared|ready||2026-10-22T13:55:19.322Z [log grep R4b] read-process-exit-status=0 ProviderAdapterTurnStartError=1 ProviderAdapterEventStreamError=0 unexpectedly=0 WARN=0 ERROR=1 | trace: writeReleasedSessionEvents=0 runtime_error=0 manual_shutdown=0 idle_timeout=0 server_shutdown=0 EventStreamError=0 read-process-exit-status=0 TurnStartError=1 13:56:07.575030363 kill -TERM 1986458 (recorded $!) 1986458 gone 1986461 STILL RUNNING listeners on 38792: 1 1986461 still running after +5s; ppid= 2928 cwd=/tmp/ev-22791/base listeners on 38792: 1 port owner: pid=1986461 13:56:56.058047857 kill -TERM 1986461 (orphaned re-exec child of recorded 1986458; owns port 38792; cwd /tmp/ev-22791/base) 1986461 gone after ~2s listeners on 38792: 0 stand-in children alive: