Repository navigation
Commit e807448
fix(workspace): publish the whole bundle as a replacement, and tell the update path's conflicts apart
Sarav's review. `files` replaces the bundle server-side, and a path it omits
is a deletion the server refuses unless the caller says so — so deleting a
file locally and publishing again 409'd, forever, and the 409 was reported
as a name conflict: "it was published from somewhere else, rename this one".
The name was never the problem, renaming does not help, and the real cause
was never mentioned.
- The PATCH sends `replace_bundle: true`. `collectBundle` walks the whole
directory, so what it sends IS the bundle and a missing path is the user's
own deletion — which is the case the flag exists for.
- The update path's 409s are told apart by the server's detail: a name
collision stays `SkillNameConflictError`, a lost compare-and-swap (the
skill was edited in the workspace mid-upload) is the new
`SkillChangedElsewhereError` — "publish again", not "rename" — and
anything unrecognised keeps the server's own words rather than being
relabelled.
- `collectBundle` skips what a working directory accumulates: `.env` and
`.env.*`, `.DS_Store`, editor backups and swap files, and never walks
`.git`, `node_modules` or `__pycache__`. A public skill's bundle is
readable tenant-wide and a secret that reaches it cannot be recalled by
deleting the local file.
- The file-count ceiling is checked before the read, so file 201 is no
longer read and decoded before being rejected.
Verified: 505 pass across the workspace + plugin suites, typecheck clean.
Mutation-checked: dropping `replace_bundle`, collapsing the 409s, and
skipping either junk guard each fail a test.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012Q51zFUmPg1WwtS5CrGJE61 parent d412091 commit e807448
2 files changed
Lines changed: 120 additions & 9 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
57 | 79 | | |
58 | 80 | | |
59 | 81 | | |
| |||
146 | 168 | | |
147 | 169 | | |
148 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
149 | 186 | | |
150 | 187 | | |
151 | 188 | | |
| |||
186 | 223 | | |
187 | 224 | | |
188 | 225 | | |
| 226 | + | |
189 | 227 | | |
190 | 228 | | |
191 | 229 | | |
| 230 | + | |
192 | 231 | | |
193 | 232 | | |
194 | 233 | | |
| |||
201 | 240 | | |
202 | 241 | | |
203 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
204 | 247 | | |
205 | 248 | | |
206 | 249 | | |
| |||
229 | 272 | | |
230 | 273 | | |
231 | 274 | | |
232 | | - | |
233 | | - | |
234 | 275 | | |
235 | 276 | | |
236 | 277 | | |
| |||
500 | 541 | | |
501 | 542 | | |
502 | 543 | | |
503 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
504 | 552 | | |
505 | 553 | | |
506 | 554 | | |
| |||
524 | 572 | | |
525 | 573 | | |
526 | 574 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
532 | 580 | | |
533 | 581 | | |
534 | 582 | | |
| |||
574 | 622 | | |
575 | 623 | | |
576 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
577 | 636 | | |
578 | 637 | | |
579 | 638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | | - | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
253 | 259 | | |
254 | 260 | | |
255 | 261 | | |
| 262 | + | |
256 | 263 | | |
257 | 264 | | |
258 | 265 | | |
| |||
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
379 | 431 | | |
380 | 432 | | |
381 | 433 | | |
| |||
0 commit comments