Repository navigation
Commit a84e7c3
committed
fix(workspace): respect a disabled entry, and serialize attaches per project
Codex round 4 on 37714b4. Two findings, both verified, and both new tests were
confirmed to fail against the unfixed code before the fix was written.
**An explicitly disabled entry is no longer silently re-enabled.** A configured
entry with `enabled: false` is reported by `MCP.status()` as `disabled`, which
this flow read as "not connected" and retried with `MCP.connect`. That call
persists `enabled: true` into whichever config file owns the entry, so for a
global `datamate` the first prompt in any bound project quietly re-enabled it for
every other project — the same class as the round-1 teardown finding, in the
opposite direction. A disabled entry is now left alone and reported as such;
only a genuinely `failed` entry is retried.
**Attaches are serialized per project, not merely per session.** The previous
commit ordered replacement attaches within a session, but the MCP client is
instance-wide, `MCP.add` is last-writer-wins, and `SessionRunState` keeps
independent runners per session id — so two prompts in the same project overlap
for real. A slower attach from one session could land after another's and leave
the runtime serving a workspace nobody is bound to, with both memos settled so no
later turn would repair it. Attaches now run through a per-project chain, which
also subsumes the per-session ordering.
`entry-disabled` joins the repairable outcomes, so enabling the entry mid-session
is picked up on the next turn rather than requiring a new session.
3 further tests: a disabled entry is neither connected nor persisted, a failed
entry is still retried exactly once, and two overlapping sessions in one project
never hold the mutating phase at the same time. The last of these asserts the
invariant directly (peak concurrency of 1) after two attempts that passed against
the unfixed code and so proved nothing.1 parent 37714b4 commit a84e7c3
2 files changed
Lines changed: 109 additions & 3 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
449 | 466 | | |
450 | 467 | | |
451 | 468 | | |
| |||
656 | 673 | | |
657 | 674 | | |
658 | 675 | | |
659 | | - | |
| 676 | + | |
660 | 677 | | |
661 | 678 | | |
662 | 679 | | |
| |||
724 | 741 | | |
725 | 742 | | |
726 | 743 | | |
727 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
728 | 780 | | |
729 | | - | |
| 781 | + | |
730 | 782 | | |
731 | 783 | | |
732 | 784 | | |
| |||
783 | 835 | | |
784 | 836 | | |
785 | 837 | | |
| 838 | + | |
786 | 839 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
0 commit comments