fix: scope instance-served state to the connected instance
Linear and GitHub logins, quotas, MCP status, skills and agent memory are served by whichever instance is connected, but each was cached globally or by directory alone — which two instances can share. Switching instances left the previous instance's answers on screen and its Linear login usable against a runtime that has no Linear. Reset them all through runtimeEndpointReset, each store guarding its in-flight requests with a generation so a response for the previous instance cannot land in the new one. The Linear team filter is now persisted per instance: a team belongs to one workspace, so carrying it across filtered the new instance's issue list down to nothing. Usage also waits for the instance to report itself initialised before loading. Providers report themselves as configured only once the instance can read their credentials, so a fetch fired at mount answered "nothing configured" for every provider and cached it — which is why Usage stayed missing from the work-status panel until Settings -> Usage forced a fresh fetch.
This commit is contained in:
@@ -186,7 +186,11 @@ mock.module("../selection-store", () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
// Spread the real module so the stub stays a patch: anything else importing
|
||||
// runtime-switch in this process still gets its remaining exports.
|
||||
const runtimeSwitchModule = await import("@/lib/runtime-switch")
|
||||
mock.module("@/lib/runtime-switch", () => ({
|
||||
...runtimeSwitchModule,
|
||||
getRuntimeApiBaseUrl: () => "",
|
||||
getRuntimeKey: () => "test-runtime",
|
||||
initializeRuntimeEndpoint: () => undefined,
|
||||
|
||||
Reference in New Issue
Block a user