From 1f46776a6b0a0d712665bbdb6fa288ba6bad2fe8 Mon Sep 17 00:00:00 2001 From: Prateek Date: Wed, 18 Feb 2026 19:06:11 +0530 Subject: [PATCH] fix: use hash-based tmux name in orchestrator attach hint The tmux attach hint after `ao start` printed the user-facing session ID (e.g. app-orchestrator) instead of the hash-based tmux session name (e.g. a3b4c5d6e7f8-app-orchestrator), causing "session not found" errors. Now captures the runtimeHandle.id from spawnOrchestrator's return value for the correct tmux target. Co-Authored-By: Claude Opus 4.6 --- packages/cli/src/commands/start.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 45cc39193..9d4d7ef6a 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -156,6 +156,7 @@ export function registerStart(program: Command): void { } // Create orchestrator session (unless --no-orchestrator or already exists) + let tmuxTarget = sessionId; // For the attach hint — updated to hash-based name after spawn if (opts?.orchestrator !== false) { const sm = await getSessionManager(config); @@ -164,6 +165,9 @@ export function registerStart(program: Command): void { exists = existing !== null && existing.status !== "killed"; if (exists) { + if (existing?.runtimeHandle?.id) { + tmuxTarget = existing.runtimeHandle.id; + } console.log( chalk.yellow( `Orchestrator session "${sessionId}" is already running (skipping creation)`, @@ -174,7 +178,10 @@ export function registerStart(program: Command): void { spinner.start("Creating orchestrator session"); const systemPrompt = generateOrchestratorPrompt({ config, projectId, project }); - await sm.spawnOrchestrator({ projectId, systemPrompt }); + const session = await sm.spawnOrchestrator({ projectId, systemPrompt }); + if (session.runtimeHandle?.id) { + tmuxTarget = session.runtimeHandle.id; + } spinner.succeed("Orchestrator session created"); } catch (err) { spinner.fail("Orchestrator setup failed"); @@ -198,7 +205,7 @@ export function registerStart(program: Command): void { } if (opts?.orchestrator !== false && !exists) { - console.log(chalk.cyan("Orchestrator:"), `tmux attach -t ${sessionId}`); + console.log(chalk.cyan("Orchestrator:"), `tmux attach -t ${tmuxTarget}`); } else if (exists) { console.log(chalk.cyan("Orchestrator:"), `already running (${sessionId})`); }