Repository navigation
Commit d5227fe
fix(workspace): drop the unreachable engine-probes arm, keep the precedence fix
Review was right that the first cut reached too far. `engine-probes.resolveBinding`
is called only from `engine-overlay` at two sites, and both sit behind
`if (!isEnabled() || isServe())`. The pin exists only when
`ALTIMATE_CODE_SERVE=1` (`pin.ts`), which is exactly the mode that bail covers,
so the pin arm added there could not run in any configuration. `manage.ts`
imports its `resolveBinding` from `./state`, which is already pin-aware, so
nothing else reached it either.
Reverted. That removes the second finding with it: the arm re-read credentials
through `currentScope()` after `resolvePinnedBinding` had validated against its
own snapshot, so a credential change between the two awaits could have paired
one account's validated id with another's scope. Deleting the code is a better
answer than guarding it, since it had no caller.
`precedence.currentBinding` is a different matter and the fix stays: `derive`
gates on `isEnabled()` alone, with no `isServe()` bail, so it does run in a
pinned session — which is why the reported prompt named two workspaces at once.
What this does NOT do, now stated plainly rather than implied: it does not make
warehouse calls execute against the pinned workspace. In serve mode
`atTurnStart` records `disabled`, `SERVING` rejects that, and `derive` settles
`unattributed` — routing is off there by design, because the extension runs its
own engine under the same key. The reachable effect is which workspace the
section names, which is the contradiction the report opens with.
Tests follow the code: the engine-probes cases are replaced with precedence
ones driven through `refresh()` under a real `Instance`, so they exercise the
path that actually runs instead of a function no caller reaches.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent d5cd388 commit d5227fe
2 files changed
Lines changed: 59 additions & 51 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
54 | 31 | | |
55 | 32 | | |
56 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 146 | + | |
| 147 | + | |
147 | 148 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
158 | 176 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
162 | 181 | | |
163 | 182 | | |
164 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
165 | 194 | | |
166 | | - | |
167 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
168 | 199 | | |
169 | 200 | | |
0 commit comments