Merge pull request #1090 from ComposioHQ/feat/issue-1088

feat(cli): hide orchestrator sessions from ao session ls by default
This commit is contained in:
Adil Shaikh 2026-04-11 12:43:07 +05:30 committed by GitHub
commit add33dca3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -35,8 +35,9 @@ export function registerSession(program: Command): void {
.command("ls")
.description("List all sessions")
.option("-p, --project <id>", "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<string, typeof sessions>();