From 0f4e2bcc3c20fe94d86a5e155dd4f93b7ecae51d Mon Sep 17 00:00:00 2001 From: adil Date: Fri, 10 Apr 2026 00:53:10 +0530 Subject: [PATCH] feat(cli): hide orchestrator sessions from `ao session ls` by default (#1088) Orchestrator sessions are control-plane sessions that clutter the ls output alongside worker sessions. Filter them out using the existing `isOrchestratorSessionName()` helper. Add `--all` / `-a` flag to include them when needed. Closes #1088 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/cli/src/commands/session.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/session.ts b/packages/cli/src/commands/session.ts index 98557b7e1..6669457c2 100644 --- a/packages/cli/src/commands/session.ts +++ b/packages/cli/src/commands/session.ts @@ -35,8 +35,9 @@ export function registerSession(program: Command): void { .command("ls") .description("List all sessions") .option("-p, --project ", "Filter by project ID") + .option("-a, --all", "Include orchestrator sessions") .option("--json", "Output as JSON") - .action(async (opts: { project?: string; json?: boolean }) => { + .action(async (opts: { project?: string; all?: boolean; json?: boolean }) => { const config = loadConfig(); if (opts.project && !config.projects[opts.project]) { console.error(chalk.red(`Unknown project: ${opts.project}`)); @@ -44,7 +45,14 @@ export function registerSession(program: Command): void { } const sm = await getSessionManager(config); - const sessions = await sm.list(opts.project); + const allSessions = await sm.list(opts.project); + + // Filter out orchestrator sessions unless --all is passed + const sessions = opts.all + ? allSessions + : allSessions.filter( + (s) => !isOrchestratorSessionName(config, s.id, s.projectId), + ); // Group sessions by project const byProject = new Map();