Skip to content

Commit df75d2b

Browse files
fix: leave codex exec runs out of the session list without sessionIndex (spacering-net#639)
## Problem A client without the `sessionIndex` extension gets its `session/list` rows from `thread/list` with an explicit `sourceKinds` list. That list included `exec`, so every `codex exec` and `codex review` run showed as a chat row in the client. Users who run `codex review` saw their session list fill up with review runs. ## Change - The fallback `sourceKinds` no longer contains `exec`. - The `sessionIndex` path already sends `sourceKinds: []`, which Codex reads as the interactive sources. The Codex TUI does the same. - The list test and two file snapshots now expect the list without `exec`. ## Tests - `tsc --noEmit` is clean. - The `list-sessions`, `session-lifecycle-v2` and `session-index` tests pass, except three `_session/list/subscribe` tests. These three also fail on `main` on Windows, so this change does not cause them.
1 parent 7c761c7 commit df75d2b

4 files changed

Lines changed: 1 addition & 5 deletions

File tree

‎src/CodexAcpClient.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,10 @@ export class CodexAcpClient {
12971297
}
12981298

12991299
async listSessions(request: acp.ListSessionsRequest): Promise<acp.ListSessionsResponse> {
1300+
// `codex exec` and `codex review` runs are not chats, so the list leaves them out, as the Codex TUI does.
13001301
const sourceKinds: ThreadSourceKind[] = [
13011302
"cli",
13021303
"vscode",
1303-
"exec",
13041304
"appServer",
13051305
"unknown",
13061306
];

‎src/__tests__/CodexACPAgent/data/session-index-list-params-legacy.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"sourceKinds": [
66
"cli",
77
"vscode",
8-
"exec",
98
"appServer",
109
"unknown"
1110
],
@@ -17,7 +16,6 @@
1716
"sourceKinds": [
1817
"cli",
1918
"vscode",
20-
"exec",
2119
"appServer",
2220
"unknown"
2321
],

‎src/__tests__/CodexACPAgent/data/session-lifecycle-v2-list.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"sourceKinds": [
2020
"cli",
2121
"vscode",
22-
"exec",
2322
"appServer",
2423
"unknown"
2524
],

‎src/__tests__/CodexACPAgent/list-sessions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ describe("CodexACPAgent - list sessions", () => {
9393
sourceKinds: [
9494
"cli",
9595
"vscode",
96-
"exec",
9796
"appServer",
9897
"unknown",
9998
],

0 commit comments

Comments
 (0)