Upload 49 files
Browse files- session_manager.py +18 -3
session_manager.py
CHANGED
|
@@ -15,9 +15,24 @@ from agent.core.agent_loop import process_submission
|
|
| 15 |
from agent.core.session import Event, OpType, Session
|
| 16 |
from agent.core.tools import ToolRouter
|
| 17 |
|
| 18 |
-
# Get
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
# These dataclasses match agent/main.py structure
|
|
|
|
| 15 |
from agent.core.session import Event, OpType, Session
|
| 16 |
from agent.core.tools import ToolRouter
|
| 17 |
|
| 18 |
+
# Get config path - works both locally (parent of backend) and in Docker (/app/configs)
|
| 19 |
+
def _get_config_path():
|
| 20 |
+
# Try local path first (when running from backend directory)
|
| 21 |
+
backend_root = Path(__file__).parent
|
| 22 |
+
local_config = backend_root / "configs" / "main_agent_config.json"
|
| 23 |
+
if local_config.exists():
|
| 24 |
+
return str(local_config)
|
| 25 |
+
|
| 26 |
+
# Try Docker path (/app/configs)
|
| 27 |
+
docker_config = Path("/app/configs/main_agent_config.json")
|
| 28 |
+
if docker_config.exists():
|
| 29 |
+
return str(docker_config)
|
| 30 |
+
|
| 31 |
+
# Fallback to parent directory structure
|
| 32 |
+
project_root = Path(__file__).parent.parent
|
| 33 |
+
return str(project_root / "configs" / "main_agent_config.json")
|
| 34 |
+
|
| 35 |
+
DEFAULT_CONFIG_PATH = _get_config_path()
|
| 36 |
|
| 37 |
|
| 38 |
# These dataclasses match agent/main.py structure
|