Repository navigation
Commit 725b8a3
committed
fix(write-to-file): tear down per-task stream state on parse failure and dispose (split 5/6 of #1066, unit U6b)
Tool-side half of #1932, stacked on unit U6a (3c5036a): the onParameterParseFailure
teardown seam on BaseTool and the rewired native-args path, the per-task partial stream
state and its cleanup primitives on WriteToFileTool released on every execute() exit, and
the dispose-time clearTaskState handoff in ClineProvider. BaseTool.ts and ClineProvider.ts
arrive here rather than on this branch's cumulative diff because the split takes them out
of #1932; plan and measured widths in
#1937 (comment).
writeToFileTool.spec.ts drops two no-explicit-any suppressions (5 -> 3) rather than
renewing them.
Review round (change-request answers): WriteToFileTool now carries one ownsPreview flag in
the per-task stream state, set once the delta commits to the diff view and read at the
parse-failure hook, at both missing-parameter returns and at the pre-streaming catch. A stream
whose path never stabilized, or that was found to belong to another path's retained session,
no longer tears down a diff session it never opened; the stream that did reach the view still
owes it a rollback before its state is released.
saveDirectly now takes the commit signal its own filesystem write carries and releases the
placeholder at the point saveChanges() releases it, so the direct-write rollback stands down at
the write instead of when the call returns. That provider hunk rides in this commit because the
signal can only be fired inside saveDirectly.
The tool specs pin both sides of the ownership rule: a never-stabilized stream leaves a
retained session alone, a stream that reached the view still gets its preview discarded before
the view is reset, and the commit-point test now has the placeholder it asserts on.1 parent d52c161 commit 725b8a3
8 files changed
Lines changed: 2697 additions & 72 deletions
File tree
- src
- __tests__
- core
- tools
- __tests__
- webview
- integrations/editor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
205 | 256 | | |
206 | 257 | | |
207 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
163 | 177 | | |
| |||
166 | 180 | | |
167 | 181 | | |
168 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
169 | 206 | | |
0 commit comments