# fix\(server\): replace a stale Codex session even with background work pending · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/33fcaf49492c1c42f121aaf788659274e7a4ba70)

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

Visibility: public

Requested revision: 33fcaf49492c1c42f121aaf788659274e7a4ba70

Requested commit: 33fcaf49492c1c42f121aaf788659274e7a4ba70

Commit: 33fcaf49492c1c42f121aaf788659274e7a4ba70

Tree: fbb6cdd00d90964f6402652d780c62e37e087271

Author: Lakshmi Tanmay

Committer: Lakshmi Tanmay

## Message

```
fix(server): replace a stale Codex session even with background work pending

A stale process fails auth on every turn, so keeping it for pending
background work only made the next user turn fail with token_expired.
A running turn still keeps the process.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

```

## Parents

- [39da4237e5dd2fcf9501610c05ad7f0e1ad7dfc9](https://git.cafe/pingdotgg/t3code/commit/39da4237e5dd2fcf9501610c05ad7f0e1ad7dfc9?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/33fcaf49492c1c42f121aaf788659274e7a4ba70?format=markdown)
