From bbbc38d6ddbd7e40430dc3a29c8752f360636a11 Mon Sep 17 00:00:00 2001 From: Alishahryar1 Date: Thu, 29 Jan 2026 15:00:34 -0800 Subject: [PATCH] fixed start dir and workspace for telegram agent --- api/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/app.py b/api/app.py index ce9e1008..1166162c 100644 --- a/api/app.py +++ b/api/app.py @@ -44,7 +44,7 @@ async def lifespan(app: FastAPI): from messaging.queue import MessageQueueManager from cli.manager import CLISessionManager - # Setup workspace - CLI should run in allowed_dir + # Setup workspace - CLI runs in allowed_dir if set (e.g. project root) workspace = ( os.path.abspath(settings.allowed_dir) if settings.allowed_dir @@ -52,11 +52,10 @@ async def lifespan(app: FastAPI): ) os.makedirs(workspace, exist_ok=True) - # Session data stored separately + # Session data (Telegram session, app sessions) stored in .agent_workspace data_path = os.path.abspath(settings.claude_workspace) os.makedirs(data_path, exist_ok=True) - # Initialize CLI manager with allowed_dir as workspace allowed_dirs = [workspace] if settings.allowed_dir else [] cli_manager = CLISessionManager( workspace_path=workspace, @@ -72,7 +71,9 @@ async def lifespan(app: FastAPI): message_queue = MessageQueueManager() # Create Telegram platform - messaging_platform = TelegramPlatform() + messaging_platform = TelegramPlatform( + session_path=os.path.join(data_path, "claude_bot.session") + ) # Create and register message handler message_handler = ClaudeMessageHandler(