Commit 2c19d90
committed
fix(sessions): keep a running continuation out of the recoverable state
A transport failure that arrived after the runner had reported its outcome
demoted a running execution back to recoverable. The card then rendered
"Answer saved, retry needed" over a turn that was under way or already
finished. Two executions of the browser pass reached terminal/completed and
still carried continuation_delivery_failed.
_mark_continuation_recoverable now passes expected_states, so only an
execution that still waits for a runner can become recoverable. The caller
reports recoverable only when the write applied. A projection that raises
still counts, because the transport failure that brought us there is real.
Two smaller corrections travel with it. _deliver answers with an "exhausted"
receipt when the bounded delivery budget is spent, so the card says "Send your
next message to retry it" instead of a promise of a redelivery that no longer
happens. And resume_recoverable_continuation settles an exhausted command
through the existing exhaustion path before the reopen, so a Send that arrives
before the sweep retargets a fresh execution instead of doing nothing.
Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk1 parent 7522fd2 commit 2c19d90
3 files changed
Lines changed: 224 additions & 13 deletions
File tree
- api/oss
- src/core/sessions/commands
- tests/pytest/unit/sessions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | | - | |
| 637 | + | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
643 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
644 | 666 | | |
645 | | - | |
| 667 | + | |
| 668 | + | |
646 | 669 | | |
647 | | - | |
| 670 | + | |
648 | 671 | | |
649 | 672 | | |
650 | 673 | | |
651 | 674 | | |
652 | 675 | | |
653 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
654 | 681 | | |
655 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
656 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
657 | 693 | | |
658 | 694 | | |
659 | 695 | | |
| |||
662 | 698 | | |
663 | 699 | | |
664 | 700 | | |
| 701 | + | |
| 702 | + | |
665 | 703 | | |
666 | 704 | | |
667 | 705 | | |
| |||
690 | 728 | | |
691 | 729 | | |
692 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
693 | 757 | | |
694 | 758 | | |
695 | 759 | | |
| |||
719 | 783 | | |
720 | 784 | | |
721 | 785 | | |
722 | | - | |
| 786 | + | |
723 | 787 | | |
724 | 788 | | |
725 | 789 | | |
| |||
858 | 922 | | |
859 | 923 | | |
860 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
861 | 929 | | |
| 930 | + | |
| 931 | + | |
862 | 932 | | |
863 | 933 | | |
864 | | - | |
865 | | - | |
| 934 | + | |
| 935 | + | |
866 | 936 | | |
867 | | - | |
| 937 | + | |
868 | 938 | | |
869 | 939 | | |
870 | 940 | | |
871 | 941 | | |
872 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
873 | 955 | | |
874 | 956 | | |
875 | 957 | | |
| |||
Lines changed: 126 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
0 commit comments