Commit a7c6194
committed
fix: apply upstream PRs anomalyco#29949 (cache stability) and anomalyco#30072 (O(N²)→O(N) streaming)
anomalyco#29949 — fix(session): move env block to tail of system prompt for cache stability
Reorders system prompt so volatile env fields (cwd, date, model id) sit at
the tail, enabling 95-98% prefix cache hit rate across fresh sessions.
Adds \n prefix to env block for canonical byte seam.
anomalyco#30072 — fix(opencode): O(N²)→O(N) text/reasoning delta accumulation
Replaces string concatenation in streaming deltas with chunked array +
lazy getter pattern, eliminating quadratic memmove in long thinking-mode
sessions (per-step drops from 61s to 21s on SWE-bench).1 parent b2a0635 commit a7c6194
4 files changed
Lines changed: 78 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
35 | 70 | | |
36 | 71 | | |
37 | 72 | | |
| |||
323 | 358 | | |
324 | 359 | | |
325 | 360 | | |
| 361 | + | |
326 | 362 | | |
327 | 363 | | |
328 | 364 | | |
329 | 365 | | |
330 | 366 | | |
331 | 367 | | |
332 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
333 | 375 | | |
334 | 376 | | |
335 | 377 | | |
| |||
635 | 677 | | |
636 | 678 | | |
637 | 679 | | |
| 680 | + | |
638 | 681 | | |
639 | 682 | | |
640 | 683 | | |
641 | 684 | | |
642 | 685 | | |
643 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
644 | 689 | | |
645 | 690 | | |
646 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
1441 | | - | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
1442 | 1447 | | |
1443 | 1448 | | |
1444 | 1449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
2343 | 2344 | | |
2344 | 2345 | | |
2345 | 2346 | | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
0 commit comments