Repository navigation
Commit 2f30f8c
committed
fix(session): only divert foreign stores, not same-session resumes (CL-10372)
Review found the writePrompt divert over-fired: on a normal same-session
resume the reactor writes the materialized prompt in pre-inference before any
writeTurns, and the prompt legitimately differs from on-disk turns (context
transforms, ephemeral turns, summaries). The prompt-only signal marked the
owner store as foreign, froze turns.jsonl, and hid new turns from load().
Rework: ownership is decided solely by writeTurns. Only a fresh store whose
first writeTurns diverges from the on-disk history (a genuinely foreign
concurrent session) diverts to versioned bases; writePromptSegmented is
rebound with it. A differing prompt alone never diverts, so resumes keep
writing turns.jsonl/prompt.jsonl as before.
Adds a regression test: same-session resume with a differing first prompt
must keep updating turns.jsonl and be visible to load(), with no versioned
file. The concurrent-clobber repro still passes.1 parent 380101d commit 2f30f8c
2 files changed
Lines changed: 40 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
640 | 673 | | |
641 | 674 | | |
642 | 675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | 609 | | |
617 | 610 | | |
618 | 611 | | |
| |||
692 | 685 | | |
693 | 686 | | |
694 | 687 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
706 | 695 | | |
707 | 696 | | |
708 | 697 | | |
| |||
0 commit comments