From 1435894033e7d770b734f00b24cc50027a8a5b58 Mon Sep 17 00:00:00 2001 From: Carlos Gutierrez Date: Mon, 16 Feb 2026 01:22:06 -0500 Subject: [PATCH] fix: pass session ID to TUI for proper session persistence The TUI was only receiving sessionId when resuming/continuing, but not for new sessions. This caused new sessions to use different ID formats than the persistence system expects, making them impossible to resume. - Always pass session.id from initializeSession() to TUI - Remove isResuming variable (no longer needed) - Ensures new sessions use proper format: session_{timestamp}_{random} - Allows --resume to find sessions correctly Fixes: Session not found error when using --resume --- src/commands/components/execute/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/commands/components/execute/index.ts b/src/commands/components/execute/index.ts index 2ec8fc1..220cf68 100644 --- a/src/commands/components/execute/index.ts +++ b/src/commands/components/execute/index.ts @@ -15,10 +15,7 @@ import type { ChatTUIOptions } from "@interfaces/ChatTUIOptions"; import type { AgentConfig } from "@/types/agent-config"; import { getConfig } from "@services/core/config"; import { getThinkingMessage } from "@constants/status-messages"; -import { - enterFullscreen, - registerExitHandlers, -} from "@utils/core/terminal"; +import { enterFullscreen, registerExitHandlers } from "@utils/core/terminal"; import { createCallbacks } from "@commands/chat-tui"; import { agentLoader } from "@services/agent-loader"; import { projectSetupService } from "@services/project-setup-service"; @@ -181,13 +178,10 @@ const execute = async (options: ChatTUIOptions): Promise => { const handleCommand = createHandleCommand(ctx, handleExit); const handleSubmit = createHandleSubmit(ctx, handleCommand); - // Only pass sessionId if resuming/continuing - otherwise show Home view first - const isResuming = options.continueSession || options.resumeSession; - const savedCascadeEnabled = config.get("cascadeEnabled"); const renderProps: RenderAppProps = { - sessionId: isResuming ? session.id : undefined, + sessionId: session.id, handleSubmit, handleCommand, handleModelSelect: handleModelSelectFn,