Skip to content

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

Open
rekram1-node wants to merge 1 commit into
v2from
mcp-pending-status
Open

feat(core): publish pending MCP status during connect#37605
rekram1-node wants to merge 1 commit into
v2from
mcp-pending-status

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Follow-up to #37308, addressing known trade-off #1 (no pending status during connect).

startServer now sets status: "pending" and publishes StatusChanged before opening the connection, so servers() and event subscribers see an accurate status for the duration of the handshake instead of the stale prior status (disabled/failed) for up to the startup timeout.

Placing this at the top of startServer covers all four entry points uniformly:

  • initial layer startup (was already pending, now also announced)
  • add() (new entries are announced at admission rather than only when the handshake settles)
  • connect() (previously showed the stale prior status mid-handshake)
  • credential-triggered reconnect (same)

Cost: transitions now emit two StatusChanged events (pending, then the outcome) instead of one. pending is an existing status the app already maps.

No mid-handshake observability in tests: asserting the transient pending state deterministically needs a fixture server with controllable connect latency (same limitation as trade-off #6). Existing suite passes (18/18), typecheck clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant