Skip to content

Commit 91dc036

Browse files
saltboCopilot
andcommitted
fix(cli): exclude closed sessions from active session count
'closed' sessions are retained on disk for tunnel history lookups but are no longer doing any work. The status command was counting them as active because the old assumption was 'anything on disk is active'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5113703 commit 91dc036

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/cli/src/commands/start.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ function formatUptime(startMs: number): string {
7272
}
7373

7474
function countActiveSessions(): number {
75-
// Count worker sessions in any non-terminal status. Terminal sessions have
76-
// their files removed by SessionManager, so anything still on disk is
77-
// either active / rate_limited / in_review / completing.
78-
return listSessions({ type: "worker" }).length;
75+
// Count worker sessions that are still doing work. "closed" sessions stay
76+
// on disk for history lookup but are no longer active.
77+
return listSessions({ type: "worker" }).filter((s) => s.status !== "closed").length;
7978
}
8079

8180
function formatProviders(all: string[]): string {

0 commit comments

Comments
 (0)