Skip to content

feat(web): open the monitoring column on connection failure, with a Console tab and failed-card border (#1621) - #1622

Merged
cliffhall merged 7 commits into
v2/mainfrom
1621-open-monitoring-on-failure
Jul 9, 2026
Merged

cliffhall merged 7 commits into
v2/mainfrom
1621-open-monitoring-on-failure

Conversation

@cliffhall

@cliffhall cliffhall commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Closes #1621

Summary

Related to #1616 (open the monitoring column on connect). On a successful connect we pin the monitoring column open; on a failed connection the user was left without an obvious way to see why. This opens the monitoring column automatically when a connection attempt fails and gives it something useful to show — a new Console tab that surfaces a failing stdio server's stderr — plus a red border on the failed server's card.

Behavior

  • Auto-open on failure — the connect-success auto-open effect (Pin Logging/History/Network as a column in InspectorView #1616) is broadened to also fire on the transition into the error status, tracked via a previous-status ref so it fires once per transition and never on a mount that starts already errored.
  • New Console tab (stderr) — a stdio server's process stderr was already captured in StderrLogState but never displayed anywhere. ConsoleScreen now renders it (search / sort / clear / export, embeddable in the column), wired through App via the existing useStderrLog hook. Console is a pinnable monitor tab like Logs/History/Network, gated to stdio servers (HTTP has no child process). It appears in the header tab menu when the column isn't pinned, and moves into the column when it is.
  • Failure column picks tabs by captured content — a failed stdio launch has an empty History (the message log is cleared on the error transition) and no Network (no HTTP), so the column would otherwise be empty. The failure column now selects tabs by which diagnostic actually captured something (stderr → Console, fetch requests → Network), always offering History alongside. It keys off content rather than the active server's transport because a connect failure fires the client disconnect event, which clears activeServer — so transport can't be read back reliably there. The memo re-runs as entries stream in.
  • Red card border — the server whose last connection attempt failed gets a red border on its ServerCard (new errored Card theme variant + --inspector-error-border token, mirroring the freshly-added green highlighted border). App tracks failedServerId: set in the non-auth handshake catch, cleared at the start of any new connect attempt, and deliberately kept out of resetSessionScopedUiState (the failure's own disconnect event would otherwise clear it the same tick). Precedence: dimmed > errored > highlighted.
  • Complements Pin Logging/History/Network as a column in InspectorView #1616 — effectivePinned allows the column while error, not only connected; it still closes on a clean disconnect or narrowing without clearing the user's monitorPinned preference.

Screencap

open-monitoring-sidebar-on-failed-connect.mov

Testing

  • Unit tests across App, InspectorView, ServerListScreen, ServerCard, and a new fully-covered ConsoleScreen (+ Storybook): auto-open on the error transition; Console (with captured stderr) is the default tab for a stdio failure even when activeServer is cleared; Network (not Console) for an HTTP failure with a captured request; Console offered as a pinnable/header-menu tab for a connected stdio server; failedServerId set on a failed connect and cleared on a new attempt; red-border variant precedence.
  • Full npm run ci passes — validate + coverage (every file clears the ≥90 per-file gate) + smoke + Storybook.
  • Verified live against a failing python -m mcp_server_time stdio server: connecting auto-opens the column to the Console tab showing the real No module named mcp_server_time stderr, and the card shows the red border.

🤖 Generated with Claude Code

On a connection failure the user was left without an obvious way to see
why. Open the monitoring column automatically on the transition into the
`error` status (mirroring the connect-success behavior from #1616) so the
diagnostics surface right when they're needed.

- Broaden the auto-open effect to fire on the transition into `error` as
  well as `connected`, tracked via a general previous-status ref so it
  fires once per transition and never on a mount that starts errored.
- A failed connect never negotiated capabilities, so the failure column
  offers History (the local client-side message log) and — for non-stdio
  transports — Network (HTTP requests), the entries that explain the
  failure. Logs is omitted (it needs the server `logging` capability).
- `effectivePinned` now allows the column while `error`, not only while
  `connected`; it still closes on a clean disconnect or narrowing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Jul 9, 2026
…#1621)

A failed stdio launch had no useful diagnostic surface: the message log
(History) is cleared on the error transition and there are no HTTP
requests (Network), so the auto-opened monitoring column was empty. The
process's stderr — which explains the failure (e.g. "No module named
mcp_server_time") — was captured in StderrLogState but never displayed.

- New ConsoleScreen renders the captured stderr stream (search / sort /
  clear / export; embeddable in the monitoring column), wired through App
  via the existing useStderrLog hook + StderrLogState.
- Console is a pinnable monitor tab like Logs/History/Network, gated to
  stdio servers (HTTP has no child process). It lives in the header menu
  when the column isn't pinned, and moves into the column when it is.
- The failure column now picks its tabs by which diagnostic actually
  captured content (stderr → Console, fetch requests → Network), not by
  the active server's transport: a connect failure fires the client
  `disconnect` event, which clears `activeServer`, so transport can't be
  read back there. The memo re-runs as stderr/fetch entries stream in, so
  the diagnostic tab appears as soon as the failing process prints.

Verified live against a failing `python -m mcp_server_time` stdio server:
the column auto-opens to Console showing the real ModuleNotFoundError.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall cliffhall changed the title feat(web): open the monitoring column on a failed connection (#1621) feat(web): open the monitoring column on connection failure, with a Console (stderr) tab (#1621) Jul 9, 2026
cliffhall and others added 2 commits July 9, 2026 14:25
The InspectorView story args predate the new required Console props, so the
"Connection Error" play story crashed rendering (`stderrLogs` undefined →
`.length` throw) — caught by the Storybook step of `npm run ci`, which I
should have run before the previous push.

- Add `stderrLogs` / `consoleUi` / `onConsoleUiChange` / `onClearConsole` /
  `onExportConsole` to the story args, with a `demoStderr` fixture.
- Make the Connection Error story a stdio-failure narrative: it now opens
  the column to Console showing the captured startup error, with `network:
  []` so Network isn't offered.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
#1621)

Flags the server whose last connection attempt failed with a red card
border, cleared when another server is connected or a new connection is
attempted — a persistent, at-a-glance companion to the failure toast and
the auto-opened monitoring column.

- App tracks `failedServerId`: set in onToggleConnection's non-auth
  handshake catch, cleared at the start of any new connect attempt. It is
  deliberately kept out of resetSessionScopedUiState, since the failure's
  own `disconnect` event would otherwise clear it the same tick (that same
  event clears `activeServer`, which is why the flag is tracked separately).
- New `errored` Card theme variant (red border via a new
  `--inspector-error-border` token), mirroring the `highlighted` green
  border. Precedence: disabled (dimmed) > errored > highlighted.
- Plumbed `erroredServerId` through InspectorView → ServerListScreen →
  ServerCard (`errored` prop).

Full `npm run ci` passes (validate + coverage + smoke + storybook).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall cliffhall changed the title feat(web): open the monitoring column on connection failure, with a Console (stderr) tab (#1621) feat(web): open the monitoring column on connection failure, with a Console tab and failed-card border (#1621) Jul 9, 2026
…ure (#1621)

Opening the monitoring column on a failed connection reflows the server
grid to fewer/narrower columns, which can push the failed card below the
fold. Scroll it into view so the red-bordered card is visible without
hunting for it.

- ServerCard scrolls itself into view on the disconnected→errored
  transition (mirrors the freshly-added highlight scroll), deferred
  ~320ms so the column open + grid reflow settle first — otherwise
  scrollIntoView targets the card's pre-reflow position. Guarded by a ref
  so it fires once per failure and won't fight a user who scrolls away.

Verified live: the failed `time` card scrolls fully into view after the
column opens. Full `npm run ci` passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 3m 50s —— View job


Review: open monitoring on connection failure (#1622)

  • Read the PR diff against origin/v2/main
  • Review App.tsx (auto-open, failedServerId)
  • Review InspectorView.tsx (failure tab selection, effectivePinned)
  • Review new ConsoleScreen
  • Review ServerCard + theme changes
  • Review tests
  • Post review feedback

Nice, well-scoped PR. The code is unusually well-commented, the content-based failure-tab selection is a clever way around the cleared activeServer, and the state wiring (failedServerId cleared at connect-start, kept out of resetSessionScopedUiState) is carefully reasoned. Coverage looks thorough. A few things worth confirming before merge — all design/edge-case questions, nothing blocking.

1. error status also covers a mid-session crash, not just a connect attempt (medium)

Both the auto-open effect and the monitor-tab derivation key off connectionStatus === "error":

// InspectorView.tsx:802
const failed = connectionStatus === "error";

But per isTerminalStatus/#1490, "error" is the canonical resting status for a mid-session transport crash of a previously-connected server too — not only a failed connect attempt. Two behavior changes fall out of that:

  • Auto-open reopens a user-closed column. If a user connects, deliberately closes the monitoring column, then the transport later dies, the becameError transition fires setMonitorPinned(true) and the column pops back open. Before this PR (Pin Logging/History/Network as a column in InspectorView #1616 required connected), a crash closed the column.
  • The tab set reorganizes on crash. After a crash, monitorAvailable switches from the connected branch (Logs/History/Network/Console by capability) to the failed content branch — which never offers Logs. A user who was mid-session watching server Logs would see that tab disappear.

Both may well be desirable ("something broke, show diagnostics"), and since isTerminalStatus tears down the message log/logs anyway the data is gone regardless — but the PR frames this purely as "connect attempt failed," so please confirm the mid-session-crash path is intended. If not, you'd need to distinguish "never handshaked" from "was connected, then errored" (e.g. a ref tracking whether this session ever reached connected).

2. A no-output stdio failure still opens to an empty column (minor)

In the failed branch, HISTORY_TAB is always pushed, so monitorAvailable.length >= 1 and effectivePinned is always true on failure. But if a stdio launch fails before writing any stderr (and there's no network), the only tab is History — which was just cleared on the error transition. So the auto-opened column shows an empty History, which is the "empty column" outcome the PR set out to avoid. Not harmful, just slightly anticlimactic — worth a mental note, no action required.

3. ERROR_SCROLL_DELAY_MS = 320 is coupled to the column's slide duration (minor)

// ServerCard.tsx:107 — "Kept just above the column's slide duration."
const ERROR_SCROLL_DELAY_MS = 320;

This magic number is a hidden dependency on the Transition duration in InspectorView. If that animation timing ever changes, the scroll silently mistargets (pre-reflow position) with no test to catch it. Consider deriving both from one shared constant so they can't drift.

4. key={index} on the entry rows (nit)

// ConsoleScreen.tsx:186
{filteredEntries.map((entry, index) => (
  <EntryRow key={index}>

Array index as key on a filtered+reversed list is the usual React anti-pattern. It's harmless here (rows are stateless/append-mostly), but a composite like `${entry.timestamp.getTime()}-${index}` would be more robust if stderr ever animates or gains per-row state. Fix this →

Minor observations (no action needed)

  • The prevStatusRef effect correctly captures prev before overwriting the ref, and the mount-guard (init ref to current status) properly avoids firing on a mount that starts errored — including under StrictMode double-invoke. 👍
  • onExportConsole early-returns on empty even though the Export button is already disabled when empty — belt-and-suspenders, fine.
  • variant precedence in ServerCard (dimmed → errored → highlighted) reads correctly, and since activeServer is cleared on the failure's disconnect, the failed card won't be dimmed — so the red border actually shows.
    · 1621-open-monitoring-on-failure

… dedupe timing (#1621)

Review feedback on #1622:

- #1 (medium): `connectionStatus === "error"` also covers a mid-session
  crash of a previously-connected server, not just a failed connect
  attempt. Scope the auto-open + failure tab set to connect attempts only:
  the auto-open effect's error arm now requires the previous status to not
  be `connected` (connecting/disconnected → error), and `failed` (render)
  requires `erroredServerId`, which the parent sets only for connect-
  attempt failures. A mid-session crash now closes the column like any
  teardown instead of reopening a user-closed column / dropping the live
  Logs tab. This also aligns the column behavior with the red border.
- #3 (minor): extract the column slide duration into a shared
  `monitorColumnAnimation.ts` (MONITOR_COLUMN_ANIM_MS +
  FAILED_CARD_SCROLL_DELAY_MS) so InspectorView's Transition and
  ServerCard's scroll delay can't drift.
- #4 (nit): composite key for ConsoleScreen entry rows instead of the
  array index.

Added a mid-session-crash test (connected → error with no erroredServerId
closes the column). Verified live: a connect failure still opens the
column to Console. Full `npm run ci` passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall

Copy link
Copy Markdown
Member Author

Thanks for the thorough review! Addressed in 87630f2:

1. error also covers a mid-session crash (medium) — Good catch; the PR framing was indeed connect-attempt failures, and the mid-session-crash side effects (reopening a user-closed column, dropping the live Logs tab) weren't intended. I scoped the failure UX to connect attempts:

  • The auto-open effect's error arm now requires the previous status to not be connected (i.e. connecting/disconnected → error), so a connected → error crash doesn't fire it.
  • Render-time failed now also requires erroredServerId !== undefined, which the parent sets only in the connect handshake catch — never on a mid-session crash. So a crash yields failed = false, effectivePinned = false, and the column closes like any teardown instead of reorganizing into the failure tabs.

This also fixes an inconsistency you implicitly surfaced: the red border (failedServerId) was already connect-attempt-only, so the column now matches it. Added a test (does not treat a mid-session crash as a connect-attempt failure).

2. No-output stdio failure opens to an empty column (minor) — Left as-is per your "no action" note. In practice the backend's grace window (server.ts holds the session ~30s so the events stream can drain queued stderr + the transport error) means stderr almost always arrives, and the memo re-runs to swap in Console when it does. A truly silent failure showing an empty History is the rare anticlimactic case, but gating "open on failure" on content would trade that for "sometimes the sidebar doesn't open at all," which I think is worse for the issue's intent.

3. ERROR_SCROLL_DELAY_MS coupled to the slide duration (minor) — Fixed. Extracted MONITOR_COLUMN_ANIM_MS (and FAILED_CARD_SCROLL_DELAY_MS = anim + 20) into a shared monitorColumnAnimation.ts; InspectorView's Transition and ServerCard's scroll delay both derive from it, so they can't drift.

4. key={index} (nit) — Fixed; composite `${entry.timestamp.getTime()}-${index}`.

Verified live against the failing python -m mcp_server_time server (column still opens to Console) and npm run ci is green.

@cliffhall

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 2m 38s —— View job


Re-review: open monitoring on connection failure (#1621)

Re-reviewed the changes since my first pass. The three actionable items from last round are all addressed cleanly.


Fixes verified ✅

  1. Mid-session crash (was medium). Correctly scoped to connect attempts now, and via two independent gates that agree:

    • The auto-open effect's error arm requires prev !== "connected" (InspectorView.tsx:723), so a connected → error crash no longer reopens a user-closed column.
    • Render-time failed additionally requires erroredServerId !== undefined (InspectorView.tsx:815), which the parent sets only in the non-auth handshake catch (App.tsx:2425) — never on a mid-session onerror. So a crash yields failed = false, effectivePinned = false, and no tab-set reorg. The new test (does not treat a mid-session crash as a connect-attempt failure) locks this in.
  2. Shared animation constant (was minor). monitorColumnAnimation.ts cleanly de-couples the magic number: InspectorView's Transition (COLUMN_ANIM_MS) and ServerCard's scroll delay (FAILED_CARD_SCROLL_DELAY_MS = anim + 20) both derive from MONITOR_COLUMN_ANIM_MS, so they can't drift. 👍

  3. key={index} (nit). Now a composite `${entry.timestamp.getTime()}-${index}` (ConsoleScreen.tsx:186).

Also confirmed the failedServerId lifecycle is airtight: cleared at connect-start (App.tsx:2331), set in the non-auth catch, kept out of resetSessionScopedUiState, and stderrLogState is torn down + recreated per server switch (App.tsx:1985, 2101) so a prior server's stderr can't leak into the next failure's Console.


Two small new observations (non-blocking)

A. A persisted monitor.tab = "History" overrides "Console leads" on a stdio failure. effectiveMonitorTab (InspectorView.tsx:875) keeps the stored tab whenever it's in monitorAvailable:

monitorAvailable.includes(monitorTab) && isMonitorTab(monitorTab)
  ? monitorTab
  : (monitorAvailable.find(isMonitorTab) ?? LOGS_TAB);

On a stdio failure with captured stderr, monitorAvailable = [Console, History]. The default (Logs) and a stored Network both fall through to Console — good. But a returning user whose last pinned tab was History would land on the (just-cleared, empty) History tab instead of the Console that holds the actual spawn error — the "anticlimactic empty column" outcome, now even when stderr was captured. The test at InspectorView.test.tsx:1450 only exercises the default-preference path, so this case is uncovered. If you want Console to always lead on a stdio failure, the failed branch could prefer monitorAvailable[0] over the stored tab. Minor — the common first-run case is correct.

B. The auto-open becameError arm doesn't gate on erroredServerId. The effect (InspectorView.tsx:717) fires setMonitorPinned(true) on any non-connected→error transition, while render-time failed additionally requires erroredServerId. So an error transition that doesn't set failedServerId (e.g. an auth-path failure that resolves to error) would flip the persisted monitorPinned preference to true with no visible column. It's benign — monitorPinned = true has no effect until the next real connect/failure, and #1616 auto-opens on a clean connect anyway — but the effect and the render gate keying off slightly different signals is a small latent inconsistency worth a mental note.

Neither blocks merge. Nice work on the revision — the dual-gate approach to the crash-vs-attempt distinction is clean and the shared-constant extraction is exactly right.
· 1621-open-monitoring-on-failure

Re-review follow-up (#1622):

- Observation A: a returning user whose last-pinned monitor tab was
  History would land on the (empty) History tab on a stdio failure instead
  of the Console diagnostic. Root cause: History is *always* empty on a
  connect failure (the message log clears on the error transition), yet it
  was pushed unconditionally, so it could precede/hide the real diagnostic.
  Fix: content-gate History like Console/Network — only offer it when it
  has entries. On a fresh failure the diagnostic (Console/Network) is the
  only tab, so it always leads, without touching tab-switching or adding
  state. This also resolves the earlier "opens onto an empty column" note:
  when nothing has been captured yet, monitorAvailable is empty and the
  column stays closed, opening reactively once stderr/fetch content lands.

Tests: stdio/HTTP failure now assert the diagnostic leads and History is
absent; added "leads with Console even when stored tab was History",
"keeps the column closed until a diagnostic has content", and "offers
History when it has captured content". Verified live (time server →
Console-only column). Full `npm run ci` passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall

Copy link
Copy Markdown
Member Author

Thanks for the re-review! Addressed A in a759777; B explained below.

A. Persisted History pin overrides "Console leads" on a stdio failure — Fixed, and your note actually pointed at a cleaner root-cause fix. History is always empty on a connect failure (the message log clears on the error transition), so pushing it unconditionally was the bug — an empty tab could precede/hide the real diagnostic. So I content-gated History exactly like Console/Network: it's only offered when history.length > 0. On a fresh connect failure that's never true, so the failure column contains only the diagnostic (Console for stdio, Network for HTTP) and it always leads — regardless of the stored monitor.tab — without touching effectiveMonitorTab or in-column tab switching.

Bonus: this also resolves your original observation #2 (the "anticlimactic empty column"). With all three tabs content-gated, monitorAvailable is empty when nothing has been captured yet, so effectivePinned is false and the column stays closed rather than opening onto an empty History — then opens reactively the moment stderr/fetch content lands (the memo already re-runs on stderrLogs/network).

New/updated tests: stdio & HTTP failure now assert the diagnostic leads with History absent; leads with Console even when the stored tab was History; keeps the failure column closed until a diagnostic has content; and offers History in the failure column when it has captured content (covers the gate's other arm). Verified live — the time failure now shows a Console-only column.

B. becameError doesn't gate on erroredServerId — Left as-is; it's benign by construction and, with A's content-gating, has no observable effect. The auto-open effect only flips the monitorPinned preference; the column's visibility is governed separately by effectivePinned, which requires failed (⇒ erroredServerId) and monitorAvailable.length > 0 (⇒ captured content). So a stray error transition with no failedServerId (and thus no content) can set monitorPinned = true but shows nothing — and monitorPinned = true is already the steady state after any successful connect (#1616), so it's not a new observable state. I deliberately didn't gate the effect on erroredServerId too, because the effect updates prevStatusRef on every status change: if erroredServerId arrived a render after the status flip (they're separate App state updates), the ref would already read "error" and the transition guard would miss the edge entirely. Keeping the effect on the pure status transition (with the prev !== "connected" guard for the crash case) is the robust signal; effectivePinned is the correct place to enforce "actually show something."

npm run ci is green.

@cliffhall

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 1m 30s —— View job


Final review: content-gated failure column (#1621)

Re-read the full diff against origin/v2/main, focused on the latest revision (a759777c, content-gating History) plus the surrounding state wiring.

  • Re-read the diff against origin/v2/main
  • Verify the History content-gating fix (feedback A)
  • Check effectivePinned / monitorAvailable interaction
  • Look for any new issues in the final state
  • Post review

Feedback A — verified ✅

Content-gating History in the failed branch (InspectorView.tsx:823) is the right root-cause fix, and cleaner than special-casing effectiveMonitorTab:

const tabs: string[] = [];
if (stderrLogs.length > 0) tabs.push(CONSOLE_TAB);
if (network.length > 0) tabs.push(NETWORK_TAB);
if (history.length > 0) tabs.push(HISTORY_TAB);
  • On a fresh stdio failure, history is empty (cleared on the error transition), so monitorAvailable = [Console] and Console leads regardless of the stored monitor.tab — a persisted History pin can no longer preempt the real diagnostic.
  • Push order (Console → Network → History) puts the diagnostic first; effectiveMonitorTab keeps a stored Console/falls through anything else to monitorAvailable.find(isMonitorTab) = the diagnostic. Correct in every branch I traced.
  • The bonus fold-in of original observation Request logging #2 is real: with all three tabs gated, monitorAvailable is empty until content lands, so effectivePinned is false and the column stays closed rather than opening onto an empty History — then opens reactively when the memo re-runs on stderrLogs/network. That's a strictly better UX than the earlier "always-open, maybe-empty" behavior.

New tests cover both arms (diagnostic-leads-with-History-absent, leads with Console even when the stored tab was History, keeps the failure column closed until a diagnostic has content, offers History … when it has captured content).

Feedback B — accept the explanation ✅

Agreed the un-gated becameError arm is benign: effectivePinned requires both failed (⇒ erroredServerId) and monitorAvailable.length > 0, so a stray error transition can flip the monitorPinned preference but shows nothing — and monitorPinned = true is already the steady state after any #1616 connect, so it's not a new observable state. Your point about keeping the effect on the pure status transition (so a one-render-late erroredServerId can't desync prevStatusRef) is the correct call; gating the effect on it would risk missing the edge.

Also confirmed in the final state

  • No stderr leak across servers. stderrLogState is recreated per server switch, and the same-server reconnect path clears the message log on the error transition, so a prior session's History/Console can't bleed into the next failure's column.
  • failedServerId lifecycle is airtight: cleared at connect-start (App.tsx:2332), set only in the non-auth handshake catch (App.tsx:2425), kept out of resetSessionScopedUiState, and the auto-open crash-guard (prev !== "connected") keeps it aligned with the red border.
  • Shared animation constant (monitorColumnAnimation.ts) and the composite EntryRow key are in place from the prior round.
  • Theme additions (errored Card variant + --inspector-error-border, consoleLine Text variant) follow the repo's token/variant conventions — no raw hex, no inline styles, no stray CSS classes.

Nothing blocking, and no new issues. The dual-gate crash-vs-attempt distinction and the content-gating both read as deliberate and well-tested. LGTM. 👍
· 1621-open-monitoring-on-failure

@cliffhall
cliffhall merged commit 0fde2d0 into v2/main Jul 9, 2026
1 check passed
@cliffhall
cliffhall deleted the 1621-open-monitoring-on-failure branch July 9, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open the monitoring sidebar on connection failure, with a Console (stderr) tab for stdio servers

1 participant