# \[Bug\]: Codex sub-agents keep failing after the shared App Server is killed by SIGKILL · Issue \#16502 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/16502)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/16502)

---

### Before submitting

- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.

### Area

apps/server

### Steps to reproduce

1. Run T3 server with Codex as a provider and start a few Codex-backed delegated tasks (`delegate_task`) so the Codex App Server is running.
2. Kill the `codex app-server` process with `SIGKILL`. In our case the kernel's out-of-memory killer did it.
3. Start a new Codex delegated task, or retry one.

### Expected behavior

T3 notices the App Server has exited and starts a new one for the next thread or turn.

### Actual behavior

Every new Codex thread fails in `ensureThread` with "Provider turn failed to start". T3 retries each one 4 times, about 0.1 s apart, and all retries fail the same way. No new `codex app-server` process is started. We saw 12 tasks fail this way over 22 minutes, and it did not recover by itself. Claude threads on the same server keep working.

This is close to #12904, which was closed when #2829 (the new orchestrator) merged. Our build includes #2829 and has the same nested cause. The difference is that here brand-new delegated threads fail too, not only further turns on the thread that was running when the process died.

From the bundled code, `makeTerminationError` in `effect-codex-app-server/src/stdio.ts` turns a failed `handle.exitCode` into `CodexAppServerTransportError` (`read-process-exit-status`). The handlers we found treat only `CodexAppServerProcessExitedError` and `CodexAppServerInputStreamEndedError` as a dead process. For a signal death `exitCode` fails rather than returning a code, so the session doesn't look exited and stays in use. We haven't tested this against source.

### Impact

Blocks work completely (for Codex, until the server restarts)

### Version or commit

0.0.46-nightly.20261005.2702

### Environment

Ubuntu, Linux 6.8.0, headless `t3 serve` as a systemd user service, Codex CLI 0.160.0, model GPT-6 Astra via `delegate_task`

### Logs or stack traces

```shell
# kernel
Out of memory: Killed process 23099 (codex) total-vm:2572184kB, anon-rss:1505720kB ... oom_score_adj:200

# T3 server, repeated for every new delegated Codex task from 16:12 onwards
WARN Orchestration effect execution failed  effectType: 'provider-turn.start'
  [cause]: ProviderTurnStartError
    [cause]: ProviderAdapterEnsureThreadError: Failed to ensure codex provider thread for app thread thread:delegated-task:...
      [cause]: CodexAppServerTransportError: Codex App Server transport operation 'read-process-exit-status' failed.
        [cause]: PlatformError: Unknown: ChildProcess.exitCode (codex app-server)
          [cause]: Error: Process interrupted due to receipt of signal: 'SIGKILL'
```

### Workaround

Restart the T3 server.

Related: #12904, #15359 (the same signal-as-read-error mapping on the desktop backend).

