Commit 66e70b6
committed
fix(runner): keep the warm session when the client sends a minimal history
The keep-alive check fingerprints the prior conversation the client sent and
compares it against what the previous turn stored. A last-message-only client
sends no prior conversation, so the fingerprint is of an empty array and can
never match. Every conversation was evicted to cold on every turn after the
first. Measured on a three-turn run, turn 2 went from 1570ms to 4623ms while the
suite still reported a pass, because a cold turn is still faster than the first.
Skip the history comparison when the request carries only its own fresh user
turn. The session id already binds the request to the conversation; a
minimal-history client simply no longer asserts it, so there is nothing to
compare. Requests that do send a history are still checked exactly as before,
including the approval-resume path, which always sends the full history.
Claude-Session: https://claude.ai/code/session_01KM69J7uHafgciiN5zfG7qR1 parent b652316 commit 66e70b6
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
595 | 596 | | |
596 | 597 | | |
597 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
598 | 604 | | |
599 | 605 | | |
600 | | - | |
| 606 | + | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
479 | 489 | | |
480 | 490 | | |
481 | 491 | | |
| |||
0 commit comments