Commit aa39435
authored
* feat(opencode): add LLM stream stall detection and check_task visibility (#398)
- Add lastTokenTime tracking in processor.ts stream loop
- Detect stalls when no tokens received for configurable timeout (default 3min, OPENCODE_STALL_TIMEOUT_MS)
- Export stalledSessions Set for cross-module stall tracking
- Extend TaskResult with stallDetected, lastToolCalls, lastActivity for running tasks
- Show last 3 tool calls with name, status, and timestamp in check_task
- Validate OPENCODE_STALL_TIMEOUT_MS for NaN and non-positive values
- Update async-tasks fork-feature manifest with stall detection markers
Fixes #398, Fixes #399, Fixes #400
* refactor(opencode): encapsulate stalledSessions, add type guard, extract getStallTimeout (#398)
- Make stalledSessions private with isSessionStalled/markSessionStalled/clearSessionStalled accessors
- Replace raw Set export with encapsulated functions for proper module boundary
- Add hasStartTime type guard replacing unsafe cast in check_task.ts
- Extract getStallTimeout() function from inline env var parsing
- Add getStallTimeout to fork-features manifest criticalCode
- Strengthen type guard to validate time.start is number
1 parent 1250207 commit aa39435
File tree
5 files changed
+539
-7
lines changed- .fork-features
- packages/opencode
- src
- session
- tool
- test
- session
- tool
5 files changed
+539
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
50 | | - | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
23 | 45 | | |
24 | 46 | | |
25 | 47 | | |
| |||
50 | 72 | | |
51 | 73 | | |
52 | 74 | | |
| 75 | + | |
| 76 | + | |
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
56 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
57 | 86 | | |
58 | 87 | | |
59 | 88 | | |
60 | 89 | | |
61 | 90 | | |
62 | 91 | | |
| 92 | + | |
63 | 93 | | |
64 | 94 | | |
65 | 95 | | |
| |||
79 | 109 | | |
80 | 110 | | |
81 | 111 | | |
| 112 | + | |
82 | 113 | | |
83 | 114 | | |
84 | 115 | | |
| |||
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
| 166 | + | |
135 | 167 | | |
136 | 168 | | |
137 | 169 | | |
| |||
178 | 210 | | |
179 | 211 | | |
180 | 212 | | |
| 213 | + | |
181 | 214 | | |
182 | 215 | | |
183 | 216 | | |
| |||
218 | 251 | | |
219 | 252 | | |
220 | 253 | | |
| 254 | + | |
221 | 255 | | |
222 | 256 | | |
223 | 257 | | |
| |||
336 | 370 | | |
337 | 371 | | |
338 | 372 | | |
| 373 | + | |
339 | 374 | | |
340 | 375 | | |
341 | 376 | | |
| |||
411 | 446 | | |
412 | 447 | | |
413 | 448 | | |
| 449 | + | |
414 | 450 | | |
415 | 451 | | |
416 | 452 | | |
| |||
445 | 481 | | |
446 | 482 | | |
447 | 483 | | |
448 | | - | |
449 | | - | |
450 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
451 | 497 | | |
452 | 498 | | |
453 | 499 | | |
454 | 500 | | |
455 | 501 | | |
456 | 502 | | |
457 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
| |||
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
87 | 114 | | |
88 | 115 | | |
89 | 116 | | |
90 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
91 | 121 | | |
92 | 122 | | |
93 | 123 | | |
| |||
0 commit comments