Repository navigation
Commit c8ff7f8
committed
fix(sleep): reset call-local delta on no-call paths + one locked accounting helper
Address the review: all token charging now routes through one locked helper
(_record_cost), and the call-local delta is reset on every no-call / early-return
path (_reset_call_delta), so a reused worker never reports a previous call's
token count — covering the OpenCode disabled-tool-replay early return, cache
hits, and the start of every tool-aware path.
Add regressions: barrier-forced concurrent _record_cost (no lost updates) and
same-thread prior-call -> disabled-tool-replay delta reset.1 parent f3ef661 commit c8ff7f8
2 files changed
Lines changed: 52 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
363 | 372 | | |
364 | 373 | | |
365 | 374 | | |
366 | 375 | | |
367 | 376 | | |
368 | 377 | | |
369 | 378 | | |
370 | | - | |
| 379 | + | |
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| |||
865 | 874 | | |
866 | 875 | | |
867 | 876 | | |
| 877 | + | |
868 | 878 | | |
869 | 879 | | |
870 | 880 | | |
| |||
1356 | 1366 | | |
1357 | 1367 | | |
1358 | 1368 | | |
| 1369 | + | |
1359 | 1370 | | |
1360 | 1371 | | |
1361 | 1372 | | |
| |||
1616 | 1627 | | |
1617 | 1628 | | |
1618 | 1629 | | |
| 1630 | + | |
1619 | 1631 | | |
1620 | 1632 | | |
1621 | 1633 | | |
| |||
1880 | 1892 | | |
1881 | 1893 | | |
1882 | 1894 | | |
| 1895 | + | |
1883 | 1896 | | |
1884 | 1897 | | |
1885 | 1898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
226 | 264 | | |
227 | 265 | | |
228 | 266 | | |
| |||
0 commit comments