Skip to content

feat(dashboard): show a session's MCP servers still connecting - #35564

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
feat/mcp-loading-indicator
Nov 13, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
feat/mcp-loading-indicator

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: While a chat session's MCP servers are still connecting, the dashboard chat shows one small indicator that says how many are ready, and stops showing it by itself once none is connecting.

A chat's first message does not wait for every MCP server the agent declares (#35245), so for a while a new session has fewer tools than it will have. With many servers that is tens of seconds: 60 servers took about 35 s to connect in the measurements on #35245. Nothing in the chat says so. A person who asks for a tool in that window is told it is not available, and cannot tell "still starting" from "broken" or "not configured". The one place that lists a session's servers is the session-options menu's MCP view, which is closed by default and does not say that anything is on its way.

Why it matters

Whether a chat feels ready is what a person sees, not only how fast the servers connect. Kiro CLI's terminal shows one dim row with a spinner while setup is in flight and hides it when nothing is loading; the dashboard shows nothing, so the same wait reads as a missing tool. This affects every user with MCP servers of their own, on the first message of every new chat, and more the more servers they have.

Not a goal

  • Making the session's MCP report say which servers are connecting, or keeping it current after the session starts. That is A session's MCP report freezes after the session starts, so a server that connects later reads as not reported #35509. Until a gateway sends it, this indicator draws nothing.
  • What the model is told about a server that is not ready, or any wait on the model's side.
  • Anything in a Bot's chat. That surface draws messages only (docs/decisions/2026-10-09-crewmate-chat-draws-messages-only.md).
  • The session-options MCP view: its rows, its error notices and its failure reasons are unchanged.
  • The embedded chat (ChatEmbed) and the crew chat window.
  • Making servers connect faster.

What changed (motivation → approach → change)

While a session's MCP servers are still connecting, the chat shows a small pill above the composer, "N of M MCP servers ready", and hides it when none is connecting. A person can open it to see each server's state.

The pill and the data it reads ship together. The session's MCP report already knows what is true of each server and stays current after the session starts (#35722, on main). This PR hands that reading to the dashboard in two payload keys and draws it. The chat receives the report over the slot-scoped mcp_report_update event and keeps it on the slot; the pill reads it there, with no request and no new event.

Scope: the "Not a goal" line about the report stands for the report's own work, which is #35722. The backend change here is two lines in payload().

Part What it does
src/kiro_crew/acp/mcp_session_report.py (payload()) Carries states, the not-ready servers by state (not_ready() as lists), and states_omitted (left_out), which is not zero when the report is partial.
website/src/pages/chat/McpLoadingBar.tsx A pill in the status stack above the composer, above the task pill: "N of M MCP servers ready". Drawn only while mcp_report.states.connecting names a server. Click or Enter opens the list.
website/src/lib/mcpSessionReport.ts (mcpSessionLoading) Reads the report into the servers the count is about (connecting, then connected) and the ones it is not about. One server, one row.
website/src/types/index.chat.ts, types/index.ts states and states_omitted on the report type, both optional; the types facade re-exports the new type.
ComposerDockView.tsx, ChatPane.tsx Mount it in the main chat and in a split pane. Not in a Bot's chat.
website/src/i18n/locales/ (12 catalogs + en-XA) Eight new strings under pages.chat.mcpLoadingBar.
docs/feature-map/README.md, docs/system-specs/modules/acp-client.md, src/kiro_crew/docs/dashboard.md One row for the pill, one sentence for the two payload keys, one line in the packaged dashboard guide.

Every name the diff adds has a writer and a reader:

  • states and states_omitted: written by McpSessionReport.payload(), read by mcpSessionLoading, which reads the second only as "the report is partial".
  • The five state keys (connecting, needs_sign_in, failed, disabled, registry_dropped): written by not_ready() on main, read by mcpSessionLoading.
  • McpSessionStates, the two optional report fields and the eight catalog strings: read by mcpSessionReport.ts and McpLoadingBar.tsx.

The rules it follows:

  • Only a connecting server is loading. N is the connected servers, M the connected plus the connecting ones. A server that failed, waits for authorization, is switched off or was left out by policy is in neither number.
  • The open list adds up. The first group is exactly the M servers, connecting ones on top. The rest sit under a line that says "Not counted: K", each with its state in the words the session-options MCP view already uses. A list taller than its box fades at the bottom edge while rows sit below it.
  • It leaves by itself. With nothing connecting it renders nothing. An open pill stays until it is closed, so a list being read is not taken away; a session reset that clears the report removes it.
  • No guess. A report without states (an agent backend that does not report it) draws nothing: a server nobody has heard from is "unreported", which is not "loading". When the report is partial, the pill says "Some servers are not tracked" and gives no number: states_omitted totals what each of the report's lists left out, so it is not a number of servers.
  • Quiet. Muted text, no accent tint. The spinner turns only under motion-safe. A screen reader hears one sentence when it appears; the count is the button's own name, not a live region.

src/kiro_crew/acp/mcp_session_report.py is 1,582 lines with this change (1,580 on main), under the 1,600-line working target.

Backwards compatibility

Compatible: the payload gains two keys and changes none, and the two fields are optional on the dashboard's type, so a report without them renders exactly what it renders on main.

Removes nothing: the diff adds two payload keys, a component, a reader function, two optional type fields, catalog keys and doc lines.

Tests

Backend, the payload:

  • test/test_mcp_report_arrival_fold.py::TestNotReady::test_the_payload_carries_the_states_and_what_the_report_left_out pins both keys: states is not_ready() as lists and follows a status frame; states_omitted is 0 while every server is tracked and 2 once two are past the report's bound.
  • The three payload-shape literals in test/test_mcp_session_report.py and test/test_mcp_session_report_wiring.py hold the two keys.

Frontend, website/src/test/McpLoadingBar.test.tsx (28 tests):

  • When it shows: nothing for no slot, no report, a report without states, all connected, or only failed / sign-in / switched-off / left-out servers.
  • The count: "2 of 5", the four not-loading states in neither number, follows mcp_report_update, goes away when the last server connects, when it fails instead, and when a reset clears the report; one catalog sentence (en-XA); digits in the app language (bn).
  • The count rule against the rows: the header's two numbers equal the first group's connected rows and all of its rows, across three report states; no connecting or connected row is ever in the second group.
  • The list: closed by default, opens from the keyboard, aria-controls names it; the second group's label and accessible name; stays open after the last server connects and goes once closed; goes away even while open when a reset clears the report, and the next session in that slot starts closed; fades its bottom edge only while rows sit below the fold; starts closed in another session; says so in words, without a number, when the report does not track every server.
  • Motion and announcements: the spinner carries motion-safe:animate-spin and never a bare animate-spin; the status sentence has no digits, is not replaced when the count changes, and the count is outside every live region.
  • mcpSessionLoading: no states means nothing connecting; a not-ready state wins over a stale ready; wire data that is not a list of names is ignored.

ChatPage.statusStackLayering.test.tsx pins the new bar's layer with the stack's other children. ChatPage.composerDock.test.tsx stubs it like its siblings.

Determinism: npx vitest run src/test/McpLoadingBar.test.tsx --sequence.shuffle --sequence.seed=<2001..2010> --retry=0 passed 10 of 10 runs, 28 tests each (Linux). The file uses no timer, clock, sleep or network: state changes are store dispatches inside act, the scroll-edge test sets the scroller's metrics by hand and fires one scroll event, and the language is set back to English after each test. The backend test builds reports in memory and folds frames by hand; it has no clock and no wait.

Manual verification

Run on an isolated gateway built from this branch (fresh data home, loopback only, stopped after the run), one real chat turn, 1280x800, nothing injected. Three stand-in MCP servers beside the four built-in ones: one that connects at once, one that takes 20 s, one that exits at start.

Moment What the page showed
4.4 s after the message first report: 4 connected, 2 connecting, 1 failed
4.8 s second report (5 connected, 1 connecting); the pill, "5 of 6 MCP servers ready"
opened late-tools "Connecting", five servers "Started in this session", and under "Not counted: 1" broken-tools "Failed to start in this session"
44.3 s report: 6 connected, none connecting; the open pill reads "6 of 6" and keeps its list
44.7 s closed by the script, the pill is gone

The 30-server recording below is from an earlier run of the same pill on a local join with the report change, before that change merged: the pill appeared at "18 of 34", followed 17 report pushes one server at a time, and left by itself at 21.0 s.

In the mock shots (closed, open with every state) the report frame is delivered to the page over its own dashboard socket by the capture script, because no real server set produces a failed, a sign-in, a switched-off and a left-out server at once; the chat, the reply and the component are real.

Screenshots / video

Before: the status stack above the composer is empty while servers connect.

before, light

Fed by a real gateway built from this branch: one server still connecting, one that failed to start.

live, one connecting and one failed, light

Fed by a real gateway, 30 public servers: the pill appears, counts up, opens into its list, closes, and leaves by itself.

live-30-servers.webm

live, open, light

Mock report, closed:

after closed, light

Mock report, open, every state at once: the counted servers first, the others under "Not counted".

after open, light

Dark theme, and the whole page

live, one connecting and one failed, dark

live, one slow server, dark

after closed, dark

after open, dark

whole page before, light

whole page after, above the task pill, light

Related Issues

Part of #35513

Reads the report that #35722 made current (#35509). Follows #35245.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 11, 2026 20:35
@bolichen97
bolichen97 requested a review from buluoray November 11, 2026 20:35
@bolichen97
bolichen97 enabled auto-merge (squash) November 11, 2026 20:48
@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider raised 2 possible problems and estimates a 55% chance that this change introduces a defect; a person should check them.

The pill is implemented and tested correctly, but it reads mcp_report.states, which no gateway code sends today (McpSessionReport.payload has no such key). So merged alone it never meets its goal of showing an indicator while servers connect. It also fixes the wire format on the reader side before #35509, the backend change that will send it, has agreed to it. Request changes: land or wait for #35509, rebase onto the real shape, and add a test built from the backend's actual payload.

Things to check (possible problems the decider raised; at this confidence many turn out to be fine):

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit b4548c181a · 773 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@bolichen97
bolichen97 force-pushed the feat/mcp-loading-indicator branch from d667f21 to 35a195d Compare November 11, 2026 21:11
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of aeccf49c2e4d2c56cc80143b1174b66704e85496 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: two additive payload keys feed a self-hiding pill, and the report already republishes between turns, so the pill can clear without another message being sent.

Notes

[DESIGN-REVIEWED] aeccf49

Description read

[DESCRIPTION-READ] 69a8c79ecd6e70a4b1cdd14e5465e464434d8c5f9b2d3420dbc18c78baa31464

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of aeccf49c2e4d2c56cc80143b1174b66704e85496 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. One part goes beyond the Goal: the open pill's "Not counted" group repeats states that the session-options MCP view already shows.

Notes

  • Item 4 — oversized: the Goal is "one small indicator that says how many are ready". The second group (uncounted: failed, sign-in, disabled, dropped) relists states that McpToolsPanel.tsx (mcpSessionServerState) already draws, and the description says "their errors and reasons stay in the session-options MCP view". Subtraction: delete uncounted, uncountedId, the not_counted/state_disabled/state_registry_dropped strings and the second <ul>, and list only counted. Clears when: the mechanism is removed, or a human amends the Goal.

What this change ships

Inventory (9 items) — 8 justified

Intent: let a person see that a new chat's MCP servers are still starting, so a missing tool doesn't read as broken. ADDITION.

  1. "N of M MCP servers ready" pill above the composer while any server is connecting — justified
  2. Pill disappears by itself once nothing is connecting — justified
  3. Clicking the pill lists the connected and connecting servers — justified
  4. "Not counted" group lists failed, sign-in, switched-off and dropped servers — oversized: repeats the session-options MCP view
  5. "Some servers are not tracked" shows instead of a count when the report is partial — justified
  6. An open pill stays open after everything connects, until it is closed — justified
  7. Same pill in a split pane; none in a Bot's chat — justified
  8. The session MCP report payload gains states and states_omitted — justified
  9. Docs and feature-map rows for the pill — justified

[FIRST-PRINCIPLES-REVIEWED] aeccf49

Description read

[DESCRIPTION-READ] ca16443a6b5ae57e177729c6d0aa10c2120381a71a8786ffcee8353307a28df2

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of aeccf49c2e4d2c56cc80143b1174b66704e85496 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the open pill once every server has connected (check mark instead of spinner) and the "Some servers are not tracked" line. Both are states the diff adds, and no screenshot shows either.

Evidence gaps

  • Open pill after the last server connects (loading false, <Check className="text-ok"> replaces the spinner, the list stays): no screenshot shows it. Attach one of the expanded pill with 0 connecting, in light and dark.
  • partial report, which renders the untracked line "Some servers are not tracked": no screenshot shows it. Attach one of the expanded pill when states_omitted > 0.

Notes

  • The description says the list "fades at the bottom edge while rows sit below it", but shot-05 shows no fade: the list stops cleanly on "postgres" under "Not counted: 4". The blind reader concluded "the count doesn't match what I see." Make MORE_BELOW_MASK visible on a row-boundary cut, or size max-h so the last visible row is half-cut.
  • The "Waiting for authorization" and "Failed to start in this session" rows offer no next step. The reader said: "nothing on screen shows how to fix or approve them". Link the "Not counted" group to the session-options MCP view, where the errors live.
  • The pill sits directly above the task pill, and both have the same shape and the same "X of Y" wording. The reader said they mean different things and "only the colour and icon differ". Add the server icon (the one the MCP view uses) to the pill's leading slot, so it reads as servers before the count is read.

[UX-REVIEWED] aeccf49

Description read

[DESCRIPTION-READ] 3ebe2591128bfb391dee33bd1d3181d9af77e3f8ae09ae59f9aa405d79f2d675

That sha256 names everything this verdict read: the PR description, plus the 14 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed aeccf49c2e4d2c56cc80143b1174b66704e85496 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] aeccf49

Verdict parsed from the review's SHA-scoped output markers for commit aeccf49c2e4d2c56cc80143b1174b66704e85496.

False positive or not applicable? A repository writer can comment:
/ai-review override fable aeccf49c2e4d2c56cc80143b1174b66704e85496 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of aeccf49c2e4d2c56cc80143b1174b66704e85496 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] aeccf49

False positive or not applicable? A repository writer can comment:
/ai-review override gpt aeccf49c2e4d2c56cc80143b1174b66704e85496 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
@bolichen97
bolichen97 force-pushed the feat/mcp-loading-indicator branch from 35a195d to 8d3ab4e Compare November 11, 2026 22:35
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 11, 2026
buluoray
buluoray previously approved these changes Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on 8d3ab4e. This adds a small "N of M MCP servers ready" pill above the composer while a session's MCP servers are still connecting, and a list of each server's state when it is opened. The two fixes from the last review are in. The types facade now exports McpSessionStates, and the two French strings use a narrow no-break space before the colon. Both guard tests now pass. Since that review, the open list also fades at its bottom edge while more rows sit below the fold, the same cue the model picker and the MCP browser use. The fade is visual only. It does not change what a screen reader hears, and it goes away once the list is scrolled to the end. A new test covers this, and it fails when the fade is removed. One small gap remains. No test checks that the fade updates when rows are added or removed without a scroll; the code handles that case by observing the rows' own box. The red backend and Windows checks on this head hold only the two tests that are already red on main. None of them comes from this change, which touches no backend file. Decisive lines: website/src/types/index.ts:71, website/src/i18n/locales/fr.json:13408-13409, website/src/pages/chat/McpLoadingBar.tsx:80, website/src/pages/chat/McpLoadingBar.tsx:132-139, website/src/test/McpLoadingBar.test.tsx ("fades its bottom edge only while rows sit below the fold")

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@bolichen97
bolichen97 force-pushed the feat/mcp-loading-indicator branch from 8d3ab4e to b4548c1 Compare November 12, 2026 06:09
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@bolichen97
bolichen97 disabled auto-merge November 12, 2026 22:58
@bolichen97
bolichen97 force-pushed the feat/mcp-loading-indicator branch from b4548c1 to 9c8412b Compare November 13, 2026 01:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 13, 2026
While any of a session's MCP servers is still connecting, the chat draws
one small pill in the status stack above the composer: "N of M MCP
servers ready". It follows the session's MCP report and is gone when
nothing is connecting. Opened, it lists the servers it counts, then the
ones it does not (failed, waiting for authorization, switched off, left
out by policy), each as what it is.

The report's payload carries what the pill reads, in the same change:
`states` (the not-ready servers by state, `not_ready()` as lists) and
`states_omitted` (`left_out`: not zero when the report is partial, which
the pill says in words, without a number). A report without `states`
draws nothing, and so does a Bot's chat.
@bolichen97
bolichen97 force-pushed the feat/mcp-loading-indicator branch from 9c8412b to aeccf49 Compare November 13, 2026 04:15
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at the owner's request. The deep review of this head is still running, and anything it finds will be posted here as a follow-up.

@KiroCrewCaptain
KiroCrewCaptain merged commit 1619852 into main Nov 13, 2026
98 of 99 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the feat/mcp-loading-indicator branch November 13, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants