Skip to content

Commit c426a47

Browse files
updated launch.json and pathing support
1 parent 254cff0 commit c426a47

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.vscode/launch.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@
77
"request": "attach",
88
"connect": {
99
"host": "localhost",
10-
"port": 5678 // change this if your debug server is running on a different port
10+
"port": 5678
11+
},
12+
"pathMappings": [
13+
{
14+
"localRoot": "${workspaceFolder}",
15+
"remoteRoot": "."
16+
}
17+
],
18+
"justMyCode": false,
19+
"console": "integratedTerminal"
20+
},
21+
{
22+
"name": "Attach to AgentEx Worker (Port 5679)",
23+
"type": "debugpy",
24+
"request": "attach",
25+
"connect": {
26+
"host": "localhost",
27+
"port": 5679
1128
},
1229
"pathMappings": [
1330
{

src/agentex/lib/cli/debug/debug_handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ async def start_temporal_worker_debug(
4444
})
4545

4646
# Start the worker process
47-
cmd = [sys.executable, "-m", "run_worker"]
47+
# For debugging, use absolute path to run_worker.py to run from workspace root
48+
worker_script = worker_path.parent / "run_worker.py"
49+
cmd = [sys.executable, str(worker_script)]
4850

4951
console.print(f"[blue]🐛 Starting Temporal worker in debug mode[/blue]")
5052
console.print(f"[yellow]📡 Debug server will listen on port {debug_port}[/yellow]")
@@ -58,7 +60,7 @@ async def start_temporal_worker_debug(
5860

5961
return await asyncio.create_subprocess_exec(
6062
*cmd,
61-
cwd=worker_path.parent,
63+
cwd=Path.cwd(), # Run from current working directory (workspace root)
6264
env=debug_env,
6365
stdout=asyncio.subprocess.PIPE,
6466
stderr=asyncio.subprocess.STDOUT,

0 commit comments

Comments
 (0)