mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-07-03 14:05:26 +02:00
fixed start dir and workspace for telegram agent
This commit is contained in:
+5
-4
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user