fix(tui): refresh MCP status for active location (#36882)

This commit is contained in:
Aiden Cline 2026-07-14 10:49:56 -05:00 committed by GitHub
commit a6b5cf94b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 86 additions and 3 deletions

View file

@ -841,7 +841,6 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
// Authenticating an MCP integration reconnects its server, which emits mcp.status.changed,
// so the mcp list refreshes here rather than off integration.updated.
case "mcp.status.changed":
if (bootstrapping) break
void result.location.mcp.server.refresh(event.location)
break
case "mcp.resources.changed":
@ -1044,7 +1043,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.server
},
async refresh(ref?: LocationRef) {
const result = await client.api.mcp.list({ location: locationQuery(ref) })
const result = await client.api.mcp.list({ location: locationQuery(ref ?? defaultLocation()) })
const key = locationKey(result.location)
setStore("location", key, {
...store.location[key],
@ -1057,7 +1056,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.resource
},
async refresh(ref?: LocationRef) {
const result = await client.api.mcp.resource.catalog({ location: locationQuery(ref) })
const result = await client.api.mcp.resource.catalog({ location: locationQuery(ref ?? defaultLocation()) })
const key = locationKey(result.location)
setStore("location", key, {
...store.location[key],