Skip to content

Surface reconnect guidance for broken Copilot connectors - #350859

Draft
Martin Aeschlimann (aeschli) wants to merge 2 commits into
mainfrom
aeschli/agents/connector-reconnect-guidance
Draft

Martin Aeschlimann (aeschli) wants to merge 2 commits into
mainfrom
aeschli/agents/connector-reconnect-guidance

Conversation

@aeschli

@aeschli Martin Aeschlimann (aeschli) commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #350845

Preserve the SDK's non-retryable reconnect failure until Connector ownership is known, and show actionable recovery guidance in tool results, MCP rows, and Connector details. Keep a broken or reconnecting Connector searchable without overriding user enablement.

Automatic reconnect

The host now reports a broken Connector connection with a distinct errorType (copilot-connector-reconnect-required). When the workbench sees it, it tries to repair the connection without user interaction:

  • It re-sends the Connector connect request using the existing Connector-scoped GitHub session. It never prompts for authentication and never opens a browser.
  • If the connection is confirmed, it restarts the affected Agent Host sessions. While it reconnects, the row shows the progress state instead of the error.
  • It falls back to a notification with a Reconnect action in any of these cases: consent is needed, there is no Connector authorization, the servers are still broken after the restart, the servers are not ready within 60 seconds, or the connection breaks again shortly after a repair. The Reconnect action disconnects and connects again through the normal consent flow.
  • Attempts are tracked per Connector across sessions, so a broken Connector is reconnected only once and produces at most one notification.

This also addresses the review comment: Connector error text is now shown only for rows owned by a Connector.

Validation

  • pnpm run build-fast --client-only: passed.
  • .\scripts\test.bat --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/copilotConnectorsService.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCustomizationService.test.ts --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/mcpListWidget.test.ts: passed (2152 tests).
  • pnpm run typecheck-client: passed.
  • node build/oxlint.ts <changed .ts files>: passed.
  • First commit: Component Explorer. The broken-Connector row and detail fixtures rendered, were inspected, and passed stability checks in the Dark and Light themes.

Not run: a live recovery from a broken provider connection, and screen-reader testing. I have not verified whether the silent connect request actually repairs a connection that the provider still reports as connected; if it does not, the notification fallback applies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 28, 2026 15:50
@aeschli
Martin Aeschlimann (aeschli) marked this pull request as draft November 28, 2026 15:51
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: adf84acb Current: 528578ca

Added (2)

chat/aiCustomizations/aiCustomizationManagementEditor/BrokenConnectorRow/Light

current

chat/aiCustomizations/aiCustomizationManagementEditor/BrokenConnectorDetail/Light

current

Copilot AI 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.

🟡 Changes recommended

A session-server row that loses Connector ownership while remaining in Error still displays Connector-only error text instead of restoring its normal description.

1 open issue
What changed in this PR

This PR addresses #350845 by preserving reconnect guidance for broken Copilot Connectors in Agent Host and surfacing it in the Chat Customizations UI.

Changes:

  • Retains specific reconnect failures across delayed ownership discovery and missing inventory.
  • Keeps broken or reconnecting Connectors searchable while respecting user enablement.
  • Adds live row and detail diagnostics, accessible labels, regression tests, and visual fixtures.
File Description
src/​vs/​workbench/​test/​browser/​componentFixtures/​sessions/​aiCustomizationManagementEditor.fixture.ts Adds broken-Connector row and detail fixtures.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​mcpListWidget.test.ts Tests live diagnostics, recovery, and late ownership updates.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​connectorPresentation.test.ts Tests detail error updates without replacing actions.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​mcpListWidget.ts Displays Connector errors and supplies live detail diagnostics.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​embeddedConnectorDetail.ts Adds a live error section to Connector details.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​aiCustomizationManagementEditor.ts Passes diagnostic observables into Connector details.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Covers failure retention, routing, recovery, and cleanup.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Preserves reconnect failures and returns actionable recovery guidance.

Review effort: Balanced

When a Connector's MCP server reports a broken connection that needs a
reconnect, repair it silently with the existing authorization and restart
its sessions. Show a progress state while reconnecting, and fall back to a
notification with a Reconnect action when consent is needed, the servers
stay broken after the restart, or they do not become ready in time.

Also only show Connector error text for rows owned by a Connector.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Agent Host: Surface reconnect guidance for broken Copilot connectors

2 participants