Repository navigation
Commit 37dd23d
committed
fix(workspace): revalidate after cached-success validation, and restore the project entry
Codex round 18. Two findings, both verified, both proven by revert.
**The memoised-success path needed the final binding check too.** Validating a
cached success is itself awaited work — status, config, and sometimes a version
probe — so the binding can move underneath it. That path lives in `ensure()`,
outside `run()`, and so never had run's closing check: a confirmed-valid engine
for the workspace just left was returned as the answer for the one just joined,
and the turn took its tools and credentials.
This is the same rule that has now been applied in four places: revalidate before
answering, because an answer this flow gives is acted on. The rule was right; it
had not been carried to the one path that does its validating elsewhere.
**A superseded attach now restores the project entry, not the merged one.**
`existingEntry()` returns the merged view, which may come from global config,
while `persist()` writes to the project file. Restoring the merged value wrote a
copy of the global entry into the project — a permanent override shadowing every
later global update, disable or removal, produced by an attach that was meant to
leave configuration untouched. The project file's own entry is snapshotted before
persisting and that is what goes back, which means removing the override when
there was nothing there before.
Undoing a write is only correct if it restores what that write replaced, and the
thing replaced was never the merged view.1 parent 3597444 commit 37dd23d
2 files changed
Lines changed: 80 additions & 3 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
340 | 359 | | |
341 | 360 | | |
342 | 361 | | |
| |||
839 | 858 | | |
840 | 859 | | |
841 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
842 | 864 | | |
843 | 865 | | |
844 | 866 | | |
| |||
873 | 895 | | |
874 | 896 | | |
875 | 897 | | |
876 | | - | |
| 898 | + | |
877 | 899 | | |
878 | 900 | | |
879 | 901 | | |
| |||
1072 | 1094 | | |
1073 | 1095 | | |
1074 | 1096 | | |
1075 | | - | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1076 | 1105 | | |
1077 | 1106 | | |
1078 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1475 | 1475 | | |
1476 | 1476 | | |
1477 | 1477 | | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
0 commit comments