feat(core): publish pending MCP status during connect (#37605)

This commit is contained in:
Aiden Cline 2026-07-18 12:02:21 -05:00 committed by GitHub
parent 5f437a09b0
commit d625bc86fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -482,6 +482,10 @@ export const layer = Layer.effect(
const startServer = (name: ServerName, entry: ServerEntry) =>
Effect.gen(function* () {
// Announce the handshake so connect() and credential reconnects don't show a stale
// disabled/failed status for the duration of the connection attempt.
entry.status = { status: "pending" }
yield* events.publish(McpEvent.StatusChanged, { server: name }).pipe(Effect.ignore)
const scope = yield* Scope.fork(root)
entry.scope = scope
const authProvider = yield* connectProvider(entry)