Commit 412e502
fix(sdk): allow Compensate from InFlight for known failures
Compensate previously only accepted Unresolved state, but agents that
observe an action fail during InFlight (e.g., HTTP error, payment
rejected) need to mark the intent as terminal immediately. Without
this, failed intents remain InFlight, Compensate silently fails, and
Prune cannot remove them — leading to stale non-terminal intents
accumulating in effect state.
Widen Compensate to accept both InFlight and Unresolved:
- InFlight → Compensated: agent observed the failure directly
- Unresolved → Compensated: agent investigated after crash
Fixes the deployer and x402buyer error paths which already called
Compensate after Begin but got silent errInvalidTransition errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3963f6c commit 412e502
2 files changed
Lines changed: 26 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
| |||
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
167 | 185 | | |
168 | 186 | | |
169 | 187 | | |
| |||
0 commit comments