Repository navigation
Commit 65b247f
authored
fix(mothership): keep local file tools running when the chat view changes (#8666)
* fix(mothership): keep local file tools running when the chat view changes
Local file reads and imports now take the same Stop-only lifetime as browser
actions: a history reconnect, a stream recovery or leaving the chat view
leaves them running so they finish and report, and only the user's Stop
cancels them.
The desktop-tool classifier in client-executed-tools.ts is removed in favour
of the single one in tools/desktop-tools.ts.
When the desktop app holds a call, confirm now answers 409 to any other
reporter (a stale replay, a lost race against the claim), and the client
treats 409 as final instead of retrying a 404 five times.
The not-started results now tell the model what it can act on: the action
never started; don't retry it in this turn; ask the user to keep the chat
open in the Sim desktop app. A local read the server cannot see picked up
is no longer described as started.
The obsolete admission probe script is deleted. Nothing ran it, it no longer
type-checked against the repository API, and the integration suites cover
the same admission behaviour against real Postgres.
* fix(mothership): Stop reaches every desktop tool of the view, and results say what is known
Desktop tools now take one lifetime the view owns and only the user's Stop
ends, so Stop still reaches a tool that a replaced stream reader started. A
held-call 409 is final on the trimmed retry of an oversized report too. The
not-started result no longer asserts why nothing picked the call up, and a
local read the desktop claimed is described as started when its result is
lost.
* fix(mothership): scope a desktop tool's Stop to its turn
A desktop tool outlives the chat view that started it, so its Stop belongs
to the turn, not the view: tools are keyed by the turn's stream id, which
survives reader replacement and remounts and differs between chats. Stop in
another chat leaves them running, and Stop from a view reopened on the turn
still reaches them.
* fix(mothership): hold a turn's Stop only while its desktop tools run
Replace the bounded LRU of turn controllers with leases: each running
browser action or local file tool holds its turn's Stop until it settles,
so a live turn can never be evicted and settled turns leave nothing behind.
* test(mothership): import the lease registry by its absolute path1 parent ba12945 commit 65b247f
23 files changed
Lines changed: 410 additions & 538 deletions
File tree
- apps/sim
- app
- api/copilot/confirm
- workspace/[workspaceId]/home/hooks
- stream
- lib/mothership
- request/tools
- tools
- client
- scripts
- probes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
303 | | - | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
87 | 99 | | |
88 | 100 | | |
89 | 101 | | |
| |||
272 | 284 | | |
273 | 285 | | |
274 | 286 | | |
275 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
276 | 292 | | |
277 | 293 | | |
278 | 294 | | |
| |||
285 | 301 | | |
286 | 302 | | |
287 | 303 | | |
288 | | - | |
| 304 | + | |
289 | 305 | | |
290 | 306 | | |
291 | 307 | | |
| |||
422 | 438 | | |
423 | 439 | | |
424 | 440 | | |
425 | | - | |
| 441 | + | |
426 | 442 | | |
427 | 443 | | |
428 | 444 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 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 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 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 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
Lines changed: 88 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
2129 | 2138 | | |
2130 | 2139 | | |
2131 | 2140 | | |
2132 | | - | |
2133 | | - | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
2134 | 2156 | | |
2135 | 2157 | | |
2136 | 2158 | | |
| |||
2140 | 2162 | | |
2141 | 2163 | | |
2142 | 2164 | | |
2143 | | - | |
2144 | | - | |
| 2165 | + | |
| 2166 | + | |
2145 | 2167 | | |
2146 | 2168 | | |
2147 | 2169 | | |
| |||
2168 | 2190 | | |
2169 | 2191 | | |
2170 | 2192 | | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
2174 | 2196 | | |
2175 | 2197 | | |
2176 | 2198 | | |
| |||
2186 | 2208 | | |
2187 | 2209 | | |
2188 | 2210 | | |
2189 | | - | |
2190 | | - | |
| 2211 | + | |
| 2212 | + | |
2191 | 2213 | | |
2192 | | - | |
2193 | | - | |
| 2214 | + | |
| 2215 | + | |
2194 | 2216 | | |
2195 | 2217 | | |
2196 | 2218 | | |
2197 | 2219 | | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
2198 | 2223 | | |
2199 | 2224 | | |
2200 | 2225 | | |
2201 | 2226 | | |
2202 | 2227 | | |
2203 | 2228 | | |
2204 | 2229 | | |
2205 | | - | |
| 2230 | + | |
2206 | 2231 | | |
2207 | 2232 | | |
2208 | 2233 | | |
| |||
2217 | 2242 | | |
2218 | 2243 | | |
2219 | 2244 | | |
2220 | | - | |
| 2245 | + | |
2221 | 2246 | | |
2222 | 2247 | | |
2223 | 2248 | | |
2224 | 2249 | | |
2225 | 2250 | | |
2226 | 2251 | | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
2227 | 2300 | | |
2228 | | - | |
| 2301 | + | |
2229 | 2302 | | |
2230 | 2303 | | |
2231 | 2304 | | |
| |||
0 commit comments