Skip to content

Commit 9ee7c6a

Browse files
committed
fix: Remove sub-agent sources from session listing
Closes #234
1 parent b93225f commit 9ee7c6a

2 files changed

Lines changed: 9 additions & 22 deletions

File tree

src/CodexAcpClient.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,6 @@ export class CodexAcpClient {
580580
"vscode",
581581
"exec",
582582
"appServer",
583-
"subAgent",
584-
"subAgentReview",
585-
"subAgentCompact",
586-
"subAgentThreadSpawn",
587-
"subAgentOther",
588583
"unknown",
589584
];
590585
const requestedCwd = request.cwd?.trim() ?? null;
@@ -605,26 +600,23 @@ export class CodexAcpClient {
605600
sourceKinds: sourceKinds,
606601
});
607602

603+
const mapThreadToSession = (thread: Thread) => ({
604+
sessionId: thread.id,
605+
cwd: thread.cwd,
606+
title: (thread.name ?? thread.preview) || null,
607+
updatedAt: new Date(thread.updatedAt * 1000).toISOString(),
608+
});
609+
608610
if (listResponse.data.length === 0) {
609611
const diagnostics = await this.runSessionListDiagnostics();
610612
logger.log("Session list diagnostics", diagnostics);
611613
}
612614

613-
let sessions = listResponse.data.map((thread) => ({
614-
sessionId: thread.id,
615-
cwd: thread.cwd,
616-
title: (thread.name ?? thread.preview) || null,
617-
updatedAt: new Date(thread.updatedAt * 1000).toISOString(),
618-
}));
615+
let sessions = listResponse.data.map(mapThreadToSession);
619616
if (requestedCwd) {
620617
const filtered = listResponse.data
621618
.filter(filterByCwd)
622-
.map((thread) => ({
623-
sessionId: thread.id,
624-
cwd: thread.cwd,
625-
title: (thread.name ?? thread.preview) || null,
626-
updatedAt: new Date(thread.updatedAt * 1000).toISOString(),
627-
}));
619+
.map(mapThreadToSession);
628620
if (filtered.length > 0 || path.isAbsolute(requestedCwd)) {
629621
sessions = filtered;
630622
} else {

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ describe("CodexACPAgent - list sessions", () => {
8181
"vscode",
8282
"exec",
8383
"appServer",
84-
"subAgent",
85-
"subAgentReview",
86-
"subAgentCompact",
87-
"subAgentThreadSpawn",
88-
"subAgentOther",
8984
"unknown",
9085
],
9186
}));

0 commit comments

Comments
 (0)