Repository navigation
Commit 44229a2
committed
fix(managed-agent): record the stranded takeover adoption instead of letting it go silent
Review round R5 (Critical R5-1). The two post-adoption load refusals
close the Session before it ever registers, so no harness route can
ever hand the owed lease back — every discharger resolves Sessions
through the registry. A persistent refusal (durable capture evidence,
read-only or full workspace store) then re-adopts and re-refuses on
every coordinator retry, straining silently until session retirement,
and the same silent strand hit the continuation takeover too. The
refusals now record the stranded (sessionId, runtimeSessionId) and
report it once per identity on stderr, a successful later load of the
Session drains the record, and the release wedge stays closed: nothing
re-adds a release to either exit, so the transient case this PR's tests
pin (release never runs, retried load settles) is untouched. From the
same round:
- The rewritten runtimeLeaseHeld contract is scoped to the
cancellation path — the continuation route keeps its #13083 handback
discipline, and the comment names that as the recorded follow-up
instead of stating an invariant four continue-route refusals falsify
(R4-4, fix-induced).
- The handback-failure log names the prompt and session identity, like
both sibling release-failure logs (R5-2).
- The final-handback test now asserts the release count right after
the replay — distinguishing the replay-path discharge from the
close-path one — and rewords the comment to match reality (R5-3).
- Design docs (EN+ZH) qualify the retirement sentence: a load refused
before registration has no session to retire; the record-and-drain
path covers it.
R4-3's two remaining fixture asks are deferred per the round-5 gate
(Critical-only), recorded in the thread. Mutation-checked: dropping
the stranded line reddens both load tests, dropping the registration
drain reddens the persistent-refusal variant, and dropping the
replay-branch release reddens the handback test at count one.1 parent b0e8b1e commit 44229a2
4 files changed
Lines changed: 153 additions & 19 deletions
File tree
- docs/design
- packages/cli/src/serve
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7062 | 7062 | | |
7063 | 7063 | | |
7064 | 7064 | | |
| 7065 | + | |
| 7066 | + | |
| 7067 | + | |
7065 | 7068 | | |
7066 | 7069 | | |
7067 | 7070 | | |
7068 | 7071 | | |
7069 | 7072 | | |
7070 | | - | |
| 7073 | + | |
7071 | 7074 | | |
7072 | 7075 | | |
7073 | 7076 | | |
7074 | 7077 | | |
7075 | | - | |
| 7078 | + | |
| 7079 | + | |
7076 | 7080 | | |
7077 | | - | |
| 7081 | + | |
| 7082 | + | |
| 7083 | + | |
| 7084 | + | |
| 7085 | + | |
| 7086 | + | |
| 7087 | + | |
| 7088 | + | |
| 7089 | + | |
| 7090 | + | |
| 7091 | + | |
| 7092 | + | |
| 7093 | + | |
| 7094 | + | |
| 7095 | + | |
| 7096 | + | |
| 7097 | + | |
7078 | 7098 | | |
7079 | 7099 | | |
7080 | 7100 | | |
7081 | 7101 | | |
| 7102 | + | |
| 7103 | + | |
| 7104 | + | |
| 7105 | + | |
| 7106 | + | |
| 7107 | + | |
| 7108 | + | |
| 7109 | + | |
| 7110 | + | |
| 7111 | + | |
| 7112 | + | |
| 7113 | + | |
| 7114 | + | |
| 7115 | + | |
| 7116 | + | |
| 7117 | + | |
| 7118 | + | |
| 7119 | + | |
| 7120 | + | |
| 7121 | + | |
| 7122 | + | |
| 7123 | + | |
| 7124 | + | |
| 7125 | + | |
| 7126 | + | |
| 7127 | + | |
| 7128 | + | |
| 7129 | + | |
| 7130 | + | |
| 7131 | + | |
| 7132 | + | |
| 7133 | + | |
| 7134 | + | |
| 7135 | + | |
| 7136 | + | |
| 7137 | + | |
| 7138 | + | |
| 7139 | + | |
| 7140 | + | |
| 7141 | + | |
| 7142 | + | |
| 7143 | + | |
| 7144 | + | |
| 7145 | + | |
| 7146 | + | |
| 7147 | + | |
| 7148 | + | |
| 7149 | + | |
| 7150 | + | |
| 7151 | + | |
| 7152 | + | |
| 7153 | + | |
| 7154 | + | |
| 7155 | + | |
| 7156 | + | |
| 7157 | + | |
| 7158 | + | |
| 7159 | + | |
| 7160 | + | |
7082 | 7161 | | |
7083 | | - | |
| 7162 | + | |
7084 | 7163 | | |
| 7164 | + | |
| 7165 | + | |
| 7166 | + | |
| 7167 | + | |
| 7168 | + | |
| 7169 | + | |
| 7170 | + | |
| 7171 | + | |
| 7172 | + | |
| 7173 | + | |
| 7174 | + | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
| 7178 | + | |
| 7179 | + | |
7085 | 7180 | | |
7086 | 7181 | | |
7087 | 7182 | | |
| |||
7196 | 7291 | | |
7197 | 7292 | | |
7198 | 7293 | | |
7199 | | - | |
| 7294 | + | |
| 7295 | + | |
7200 | 7296 | | |
7201 | 7297 | | |
7202 | 7298 | | |
| 7299 | + | |
7203 | 7300 | | |
7204 | 7301 | | |
7205 | 7302 | | |
| 7303 | + | |
7206 | 7304 | | |
7207 | 7305 | | |
7208 | 7306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
1719 | 1721 | | |
1720 | 1722 | | |
1721 | 1723 | | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1722 | 1728 | | |
1723 | 1729 | | |
1724 | 1730 | | |
| |||
1728 | 1734 | | |
1729 | 1735 | | |
1730 | 1736 | | |
| 1737 | + | |
1731 | 1738 | | |
1732 | 1739 | | |
1733 | 1740 | | |
| |||
1783 | 1790 | | |
1784 | 1791 | | |
1785 | 1792 | | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
1786 | 1796 | | |
1787 | 1797 | | |
1788 | 1798 | | |
| |||
2436 | 2446 | | |
2437 | 2447 | | |
2438 | 2448 | | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
2442 | | - | |
2443 | | - | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
2444 | 2475 | | |
2445 | 2476 | | |
2446 | 2477 | | |
| |||
2873 | 2904 | | |
2874 | 2905 | | |
2875 | 2906 | | |
2876 | | - | |
| 2907 | + | |
2877 | 2908 | | |
2878 | 2909 | | |
2879 | 2910 | | |
| |||
0 commit comments