Commit d45bafc
committed
feat: add external session support and Agent tool recognition
Detect and track Claude Code sessions running in the VS Code extension
panel (WebSocket transport, no terminal). These produce JSONL transcripts
like terminal sessions but have no associated Terminal object.
Changes:
- Make terminalRef optional, add isExternal flag to AgentState
- Add external session scanning (5s interval) and stale cleanup (5min timeout)
- Persist/restore external agents across reloads
- Guard terminal-specific code paths (focus, close, /clear reassignment)
- Recognize renamed 'Agent' tool alongside 'Task' for sub-agents
Known limitation: external sessions rely on JSONL file mtime for stale
detection (no close event available), so agents linger up to 5 minutes
after the extension panel session ends.
Supersedes pablodelucca#76 and pablodelucca#77.1 parent 20cbf80 commit d45bafc
File tree
6 files changed
+332
-19
lines changed- src
6 files changed
+332
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
101 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
102 | 128 | | |
103 | 129 | | |
104 | 130 | | |
| |||
160 | 186 | | |
161 | 187 | | |
162 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
163 | 218 | | |
164 | 219 | | |
165 | 220 | | |
| |||
388 | 443 | | |
389 | 444 | | |
390 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
391 | 454 | | |
392 | 455 | | |
393 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
186 | | - | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
220 | | - | |
221 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
222 | 239 | | |
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
| 243 | + | |
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
| |||
240 | 258 | | |
241 | 259 | | |
242 | 260 | | |
243 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
| |||
346 | 368 | | |
347 | 369 | | |
348 | 370 | | |
349 | | - | |
| 371 | + | |
350 | 372 | | |
| 373 | + | |
351 | 374 | | |
352 | 375 | | |
353 | 376 | | |
354 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
355 | 381 | | |
356 | 382 | | |
357 | 383 | | |
| |||
362 | 388 | | |
363 | 389 | | |
364 | 390 | | |
| 391 | + | |
365 | 392 | | |
366 | 393 | | |
367 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
0 commit comments