diff --git a/src/tui/tui.ts b/src/tui/tui.ts index 073685302..03d2cc86e 100644 --- a/src/tui/tui.ts +++ b/src/tui/tui.ts @@ -309,9 +309,13 @@ export async function runTui(opts: TuiOptions) { includeUnknown: false, agentId: listAgentId, }); - const entry = result.sessions.find( - (row) => row.key === currentSessionKey, - ); + const entry = result.sessions.find((row) => { + // Exact match + if (row.key === currentSessionKey) return true; + // Also match canonical keys like "agent:default:main" against "main" + const parsed = parseAgentSessionKey(row.key); + return parsed?.rest === currentSessionKey; + }); sessionInfo = { thinkingLevel: entry?.thinkingLevel, verboseLevel: entry?.verboseLevel,