Stop re-sending what the model already read A session that worked the issue boards took 59 minutes over 51 steps, and the gaps grew with it: 13s early, 192s in the middle, 705s at the end. The shape is unmistakable — latency tracked the transcript, not the work. Measured from the trajectory, what went back to the model on every round was 90,778 bytes, and 82,546 of them were tool output. Ninety-one per cent of every request was output the model had already read, re-read twenty-five times. Tool results are now bounded on the transcript at 4,000 characters, head and tail kept, with the omission counted. The reader still sees all of it; this is only what is re-sent. Both lanes do it, because both re-send. The reader's other guess — that the model's own reasoning was going back too — is worth recording as false. Reasoning is display-only and was never on the transcript; the 150,322 characters of it in that session were generated, not re-read. That is a second and separate cost, and it is what `shift+tab` is for. Usage is now reported however a turn ends. It was yielded only where a turn finished cleanly, so the expensive ones — interrupted, or having lost the server — recorded nothing, and a three-turn export showed one turn's figures for the whole session. That is also what would have settled the question above without arithmetic, so it is fixed first. And `/help` is a command. It was going to the model, which answered with nothing. The keys and the commands are the interface's own facts and it should not have to ask anything to state them. 412 tests pass.
Stop re-sending what the model already read
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
Not deployed through the forge lane
No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.
Changed files
-
modified
packages/openagents-cli/src/coder-ollama.ts -
modified
packages/openagents-cli/src/coder-session.ts -
modified
packages/openagents-cli/src/coder-thread.ts -
modified
packages/openagents-cli/test/coder-ollama.test.ts
Diff
4 files changed, +161 -13
packages/openagents-cli/src/coder-ollama.ts modified +46 -12
@@ -31,6 +31,27 @@ const DEFAULT_HOST = "http://127.0.0.1:11434";
| 31 | 31 |
|
| 32 | 32 |
|
| 33 | 33 |
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 34 | 55 |
|
| 35 | 56 |
|
| 36 | 57 |
|
@@ -233,6 +254,10 @@ export class OllamaReplySource implements ReplySource {
| 233 | 254 |
|
| 234 | 255 |
|
| 235 | 256 |
|
| 257 |
|
|
| 258 |
|
|
| 259 |
|
|
| 260 |
|
|
| 236 | 261 |
|
| 237 | 262 |
|
| 238 | 263 |
|
@@ -339,6 +364,18 @@ export class OllamaReplySource implements ReplySource {
| 339 | 364 |
|
| 340 | 365 |
|
| 341 | 366 |
|
| 367 |
|
|
| 368 |
|
|
| 369 |
|
|
| 370 |
|
|
| 371 |
|
|
| 372 |
|
|
| 373 |
|
|
| 374 |
|
|
| 375 |
|
|
| 376 |
|
|
| 377 |
|
|
| 378 |
|
|
| 342 | 379 |
|
| 343 | 380 |
|
| 344 | 381 |
|
@@ -350,9 +387,9 @@ export class OllamaReplySource implements ReplySource {
| 350 | 387 |
|
| 351 | 388 |
|
| 352 | 389 |
|
| 353 |
|
|
| 354 |
|
|
| 355 |
|
|
| 390 |
|
|
| 391 |
|
|
| 392 |
|
|
| 356 | 393 |
|
| 357 | 394 |
|
| 358 | 395 |
|
@@ -432,9 +469,9 @@ export class OllamaReplySource implements ReplySource {
| 432 | 469 |
|
| 433 | 470 |
|
| 434 | 471 |
|
| 435 |
|
|
| 436 |
|
|
| 437 |
|
|
| 472 |
|
|
| 473 |
|
|
| 474 |
|
|
| 438 | 475 |
|
| 439 | 476 |
|
| 440 | 477 |
|
@@ -452,10 +489,7 @@ export class OllamaReplySource implements ReplySource {
| 452 | 489 |
|
| 453 | 490 |
|
| 454 | 491 |
|
| 455 |
|
|
| 456 |
|
|
| 457 |
|
|
| 458 |
|
|
| 492 |
|
|
| 459 | 493 |
|
| 460 | 494 |
|
| 461 | 495 |
|
@@ -463,7 +497,7 @@ export class OllamaReplySource implements ReplySource {
| 463 | 497 |
|
| 464 | 498 |
|
| 465 | 499 |
|
| 466 |
|
|
| 500 |
|
|
| 467 | 501 |
|
| 468 | 502 |
|
| 469 | 503 |
|
@@ -503,6 +537,6 @@ export class OllamaReplySource implements ReplySource {
| 503 | 537 |
|
| 504 | 538 |
|
| 505 | 539 |
|
| 506 |
|
|
| 540 |
|
|
| 507 | 541 |
|
| 508 | 542 |
|
packages/openagents-cli/src/coder-session.ts modified +28
@@ -542,6 +542,34 @@ export class CoderSession {
| 542 | 542 |
|
| 543 | 543 |
|
| 544 | 544 |
|
| 545 |
|
|
| 546 |
|
|
| 547 |
|
|
| 548 |
|
|
| 549 |
|
|
| 550 |
|
|
| 551 |
|
|
| 552 |
|
|
| 553 |
|
|
| 554 |
|
|
| 555 |
|
|
| 556 |
|
|
| 557 |
|
|
| 558 |
|
|
| 559 |
|
|
| 560 |
|
|
| 561 |
|
|
| 562 |
|
|
| 563 |
|
|
| 564 |
|
|
| 565 |
|
|
| 566 |
|
|
| 567 |
|
|
| 568 |
|
|
| 569 |
|
|
| 570 |
|
|
| 571 |
|
|
| 572 |
|
|
| 545 | 573 |
|
| 546 | 574 |
|
| 547 | 575 |
|
packages/openagents-cli/src/coder-thread.ts modified +19 -1
@@ -79,6 +79,17 @@ const THREADS_PATH = "/api/v3/threads";
| 79 | 79 |
|
| 80 | 80 |
|
| 81 | 81 |
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 82 | 93 |
|
| 83 | 94 |
|
| 84 | 95 |
|
@@ -422,7 +433,14 @@ export class ThreadReplySource implements ReplySource {
| 422 | 433 |
|
| 423 | 434 |
|
| 424 | 435 |
|
| 425 |
|
|
| 436 |
|
|
| 437 |
|
|
| 438 |
|
|
| 439 |
|
|
| 440 |
|
|
| 441 |
|
|
| 442 |
|
|
| 443 |
|
|
| 426 | 444 |
|
| 427 | 445 |
|
| 428 | 446 |
|
packages/openagents-cli/test/coder-ollama.test.ts modified +68
@@ -442,3 +442,71 @@ describe("how hard the model is asked to think", () => {
| 442 | 442 |
|
| 443 | 443 |
|
| 444 | 444 |
|
| 445 |
|
|
| 446 |
|
|
| 447 |
|
|
| 448 |
|
|
| 449 |
|
|
| 450 |
|
|
| 451 |
|
|
| 452 |
|
|
| 453 |
|
|
| 454 |
|
|
| 455 |
|
|
| 456 |
|
|
| 457 |
|
|
| 458 |
|
|
| 459 |
|
|
| 460 |
|
|
| 461 |
|
|
| 462 |
|
|
| 463 |
|
|
| 464 |
|
|
| 465 |
|
|
| 466 |
|
|
| 467 |
|
|
| 468 |
|
|
| 469 |
|
|
| 470 |
|
|
| 471 |
|
|
| 472 |
|
|
| 473 |
|
|
| 474 |
|
|
| 475 |
|
|
| 476 |
|
|
| 477 |
|
|
| 478 |
|
|
| 479 |
|
|
| 480 |
|
|
| 481 |
|
|
| 482 |
|
|
| 483 |
|
|
| 484 |
|
|
| 485 |
|
|
| 486 |
|
|
| 487 |
|
|
| 488 |
|
|
| 489 |
|
|
| 490 |
|
|
| 491 |
|
|
| 492 |
|
|
| 493 |
|
|
| 494 |
|
|
| 495 |
|
|
| 496 |
|
|
| 497 |
|
|
| 498 |
|
|
| 499 |
|
|
| 500 |
|
|
| 501 |
|
|
| 502 |
|
|
| 503 |
|
|
| 504 |
|
|
| 505 |
|
|
| 506 |
|
|
| 507 |
|
|
| 508 |
|
|
| 509 |
|
|
| 510 |
|
|
| 511 |
|
|
| 512 |
|