Commit 9223f68
committed
fix(provider): use a larger stall budget while a Cursor tool is in flight
The stream watchdog re-armed only from push(), which fires for the ten
mapped update types. A long shell command, build, or test suite streams
nothing between tool-call-started and tool-call-completed, so a healthy
run was cancelled at the 60s budget and the turn lost.
Split the budget in two: an idle budget (OPENCODE_CURSOR_STALL_MS,
raised 60000 -> 120000) and a tool-phase budget applied while at least
one tool call is open (OPENCODE_CURSOR_TOOL_STALL_MS, default 600000,
0 disables just that bound). A tool-phase stall stays terminal and now
names the tool still in flight.
Also re-arm on any raw SDK update rather than only mapped ones, so
progress/heartbeat types the plugin does not model still count as
liveness. The re-arm runs after the switch so it observes post-mutation
openTools state and always selects the correct budget.
Reconcile openTools on turn-ended and on the forced resend: a dropped
or differently-keyed completion would otherwise pin the turn to the
10-minute budget and name a tool that had already finished.
Harden env parsing: Number("abc") is NaN and NaN <= 0 is false, so the
old guard passed and setTimeout(fn, NaN) fired immediately, stalling
every turn. Non-finite values now fall back to the default; an empty
string still disables, preserving the existing escape hatch.1 parent 5c65825 commit 9223f68
4 files changed
Lines changed: 401 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
7 | 22 | | |
8 | 23 | | |
9 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
385 | 396 | | |
386 | 397 | | |
387 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 | | |
68 | 82 | | |
69 | 83 | | |
| |||
85 | 99 | | |
86 | 100 | | |
87 | 101 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
91 | 111 | | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
95 | 119 | | |
96 | 120 | | |
97 | 121 | | |
| |||
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
| 129 | + | |
105 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
106 | 135 | | |
107 | 136 | | |
108 | | - | |
| 137 | + | |
109 | 138 | | |
110 | 139 | | |
111 | 140 | | |
| |||
135 | 164 | | |
136 | 165 | | |
137 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
138 | 170 | | |
139 | 171 | | |
140 | 172 | | |
| |||
143 | 175 | | |
144 | 176 | | |
145 | 177 | | |
| 178 | + | |
146 | 179 | | |
147 | 180 | | |
148 | 181 | | |
| |||
158 | 191 | | |
159 | 192 | | |
160 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
161 | 198 | | |
162 | 199 | | |
163 | 200 | | |
164 | 201 | | |
165 | 202 | | |
166 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
167 | 210 | | |
168 | 211 | | |
169 | 212 | | |
| |||
257 | 300 | | |
258 | 301 | | |
259 | 302 | | |
260 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
261 | 313 | | |
262 | 314 | | |
263 | 315 | | |
| |||
271 | 323 | | |
272 | 324 | | |
273 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
274 | 329 | | |
275 | 330 | | |
276 | 331 | | |
| |||
0 commit comments