# \[Bug\]: Managed ChatGPT login gets expired-token 401 during long Codex runs · Issue \#17445 · pingdotgg/t3code

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

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

Visibility: public

State: completed

Priority: 0

## Description

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

---

### 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. Use T3 Code v0.0.45.
2. Connect a ChatGPT account through Settings → Providers → “Connect with ChatGPT”, rather than using an existing Codex CLI login.
3. Start a task that keeps Codex working in one uninterrupted agent run.
4. Let the run continue for approximately 20–40 minutes, up to 1 hour.

This consistently fails during sufficiently long runs. The failure time varies; it is not a fixed timeout and does not require multiple user messages.

### Expected behavior

Long-running tasks should continue without requiring manual sign-in. If credentials expire during a run, the integration should renew them and recover without losing the conversation.

### Actual behavior

The run fails with:

`unexpected status 401 Unauthorized: Provided authentication token is expired. Please try signing in again., url: https://api.openai.com/v1/responses, cf-ray: a473...`

Reconnecting the ChatGPT account does not prevent recurrence. Fully quitting/reopening T3 and then asking it to continue does not prevent recurrence during another long run. Asking it to continue without restarting also does not prevent recurrence.

### Impact

Major degradation or frequent failure

### Version or commit

0.0.45 (6c8fed35dded)

### Environment

macOS 27.0.1, T3 Code (Alpha) 0.0.45 (6c8fed35dded)

### Logs or stack traces

```shell

```

### Screenshots, recordings, or supporting files

[Screenshot 2026-10-09 at 10.22.36.png](https://github.com/user-attachments/assets/42b2a1d2-2857-4970-85e3-b1fbd258afd4)

### Workaround

No lasting workaround found.

Possibly related to #14356, but this report is based on actual repeated failures in T3 Code. The observed error is an expired-token 401 from /v1/responses; I have not confirmed an invalid_grant refresh error.
