# \[Bug\]: \`t3 auth session list\` reports connected: false for every session, live ones included \(CLI has its own in-memory state\) · Issue \#21236 · pingdotgg/t3code

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

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

Visibility: public

State: backlog

Priority: 0

## Description

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

---

### 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

- [x] apps/server

### Steps to reproduce

1. Run the server (for example as a systemd user service) and connect a client: desktop over SSH, or a paired phone.
2. On the same host, run `t3 auth session list --json`.

### Expected behavior

`connected` is `true` for the sessions that have a live WebSocket, as in the app's Settings → Connections (`/api/auth/clients`).

### Actual behavior

`connected` is `false` for every session, including the ones carrying live connections at that moment (checked against `ss` and the server's `markConnected`/`markDisconnected` trace spans).

The cause, from the source: connection state lives only in the server process's memory (`SessionStore` `connectedSessionsRef`). The CLI builds its own `EnvironmentAuth.layerRuntime` (`apps/server/src/cli/auth.ts:42`), so its map is always empty. For the same reason, `t3 auth session revoke` only updates the database. As far as I can tell, it never reaches the running server's invalidation channel, so a live socket on a revoked session stays up until it drops.

This matters when cleaning up the session pile-ups of #20288. The new docs (#20445) point to the CLI for revoking unused sessions, but its `connected` column can't tell an unused session from a live one. The only reliable signal from the CLI is a null `lastConnectedAt` ("never connected").

### Impact

Minor bug or occasional failure

### Version or commit

Server 0.1.0; `apps/server/src/cli/auth.ts` on `main` (2026-10-18) still uses `layerRuntime`.

### Environment

Linux, server run as a systemd user service; the CLI is run as the same user on the same host.

### Logs or stack traces

```text
t3 auth session list --json  -> 442 sessions, all "connected": false
ss -tn state established | grep 127.0.0.1:3773  -> 2 live client connections at the same moment
```

### Workaround

None from the CLI. Use Settings → Connections in the app, or `/api/auth/clients` with a session that has the right scope.

