Repository navigation
Commit ce5331d
fix(workspace): tear down a disabled engine, and close the seam the restore fix opened
Three defects, each proven by individual revert.
A disabled entry stopped at the config. `MCP.status()` reports live client
state and `MCP.tools()` gates on exactly that status — it reads the config
only for a timeout — so an entry disabled AFTER it connected kept exporting
its tools and credentials to `resolveTools`. The branch already documented
this in a comment and still returned without touching the runtime. It now
detaches through the existing rejection path, which is runtime-only and
writes no config: respecting the edit, not re-applying it.
The same check was unreachable from the memoised-success path. Validation
covered connectivity, pin and version but never `enabled`, so a session that
had already attached rode its memo past a disable for the rest of its life.
The check goes in ahead of the command-unchanged shortcut, and returns false
rather than detaching directly — routing the session back through `run()`,
where the reporting and the teardown already live.
The third was introduced by the previous commit: snapshotting the project
entry for a restore put an awaited disk read between the final binding check
and the install it guards. The late guard would undo the stale attach, but
only after spawning an engine and taking the per-project lock — long enough
for the replacement's first-turn wait to expire, which is the failure that
guard exists to prevent. The snapshot moves above the check, so nothing
awaits between the check and the mutations.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y9X4vNjkwQ3vTiJ8w1kKR61 parent 37dd23d commit ce5331d
2 files changed
Lines changed: 96 additions & 3 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
666 | 675 | | |
667 | 676 | | |
668 | 677 | | |
| |||
852 | 861 | | |
853 | 862 | | |
854 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
855 | 875 | | |
856 | 876 | | |
857 | 877 | | |
858 | 878 | | |
859 | 879 | | |
860 | 880 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | 881 | | |
865 | 882 | | |
866 | 883 | | |
| |||
979 | 996 | | |
980 | 997 | | |
981 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
982 | 1009 | | |
983 | 1010 | | |
984 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1523 | 1523 | | |
1524 | 1524 | | |
1525 | 1525 | | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
0 commit comments