Repository navigation
Commit 218f0c8
committed
fix(tools): finalize the empty-content write_to_file ask on a refused rollback
handlePartial finalized the partial ask for a refused streaming rollback only inside its
`if (newContent)` guard. A stream that asked with an empty content string skipped it: the ask
was already on screen, this return is the last thing the delta does, and execute() then exits
through its own fail-closed refusal guard without touching that ask - so the spinner and the
Save/Reject buttons stay live for a preview that will never be opened.
Move the refusal check above the content guard. Non-empty content keeps the identical order
and release: resetTaskPartialState drops only this task's stream entry and its abort listener,
so the taskRollbackFailures marker survives and execute() still owns the refusal report.
The added test seeds a refused rollback for a delta that asks with content "" and asserts the
ask is finalized with that same message and that no preview is opened. With the check moved
back inside the guard that test fails with
`AssertionError: expected "vi.fn()" to be called with arguments: [ StringContaining "\"content\":\"\"" ]`
(Number of calls: 0); with it outside the guard core/tools reports 736 passed | 5 skipped (741).
No test was skipped and no suppression was added.1 parent 64a10e3 commit 218f0c8
2 files changed
Lines changed: 40 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
637 | 650 | | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
178 | 205 | | |
179 | 206 | | |
180 | 207 | | |
| |||
0 commit comments