Skip to content

Show managed plugin install progress and failures in Agent Host chat - #340117

Draft
Anthony Kim (anthonykim1) wants to merge 5 commits into
mainfrom
anthonykim1/managed-plugin-install-progress
Draft

Anthony Kim (anthonykim1) wants to merge 5 commits into
mainfrom
anthonykim1/managed-plugin-install-progress

Conversation

@anthonykim1

@anthonykim1 Anthony Kim (anthonykim1) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of: https://github.com/microsoft/vscode-internalbacklog/issues/8906

TL;DR: Before a message starts, a Copilot session can install or update plugins required by the organization. It reports progress as session.info and failures as session.warning, both with type managed_plugins. Agent Host only logs these events, so chat sits on a generic "Working" and failures never reach the user. This PR shows the progress text in the waiting turn's status line and the failure as a warning in that turn. No SDK or protocol change.

Current flow

  • The message waits while required plugins are prepared; chat shows "Working".
  • On failure, the session continues without the plugin; VS Code only writes the warning to the log.

New flow

  • Progress text ("Installing…", "Updating…", strict mode's "Initializing chat…") becomes the chat's activity while the turn is still pending. The status line reads chat activity, as it does for "Creating isolated worktree…", and the activity is mirrored onto the session summary that session lists show.
  • The root user.message echo, root assistant.turn_start, a failure, or the end of the turn clears it.
  • A failure becomes a warning-severity ManagedPluginPreparationFailure system notification in the waiting turn. Chat renders it as a warning that stays visible when the response collapses, with the message text escaped like the BYOK tool-limit notice.
  • Progress outside a pending turn (for example, preparation started by custom agent selection) is only logged. A failure that arrives while no message is waiting, for example after a background policy refresh, is shown in the next sent turn unless a managed_plugins_complete info arrives first. Other AHP clients get plain activity text and a plain-text notification.

Screenshots (live in Code OSS with this PR, against a Copilot session that reports managed_plugins events, a test org policy that requires plugins, and a local plugin marketplace; click to expand)

Install: the waiting turn says why it is waiting

Installing plugins required by your organization admin…

Here a chat's second message waits while a plugin that failed earlier installs. The Sessions list shows the same text as the chat's description:

Message waiting for the install, with the same text in the Sessions list

That turn's answer lists the new plugin's skill (release-checklist-run):

Skill list after the install

Update: the same status line with the update text

Updating plugins required by your organization admin…

Failure: a warning in the turn, and the answer continues

The warning text is the event's message as received.

Failure warning in the turn

Strict mode's "Initializing chat…" uses the same status line; it was not captured live.

Why the status line instead of the original spinner row (design mockup)

The spinner row needs a new protocol field so the client can tell this activity apart from others. The status line reuses existing activity plumbing; text and timing are the same.

Status line vs spinner row

Not in this PR

  • A4 (persistent chat-input notice): dropped per feedback.
  • C1 (repository-configured plugins): belongs with chat: Auto-install repository-configured plugins #338945; its action should read "Continue without waiting" rather than "Skip".
  • Plugin-name chips (the events carry no plugin list), a "Show Log" link, and restoring the warning after reload (live only, like the BYOK notice).
  • Intent, Fusion, and slash-command activity still go out as session activity, which the status line does not read (see the TODO on _emitAction). Only plugin preparation moves to chat activity here.

Risk to flag: Selecting a custom agent can also wait for plugin preparation, and setAgent gives rpc.agent.select a 30s control-plane timeout. A long install during agent selection can time out and mark the session for resync. Not changed here.

How to test

  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/stateToProgressAdapter.test.ts: 1100 passing. The 8 new host tests fail against main's copilotAgentSession.ts.
  • npm run typecheck-client: the same 385 errors as main in my environment (stale local node_modules); none new.
  • npx eslint on the changed files: clean.
  • Manual (done; screenshots above): with an org policy that requires a plugin, send a message. While the message waits, the status line shows "Installing plugins required by your organization admin…" and the Sessions list shows the same text; when the message waits for the install, the plugin's skill is available in that turn. After a new plugin version is published, a new chat shows "Updating plugins…" while its message waits. With an unreachable plugin source, a warning appears in the turn and the message is still answered. Once the plugin is installed, a follow-up message shows no plugin text.

Inspirations from:

The Copilot runtime prepares plugins required by the organization before
it admits a message, and reports progress and failures as session.info and
session.warning events of type managed_plugins. Agent Host only logged
them, so chat showed a generic "Working" and failures never reached the
user.

- Show the progress message as the waiting turn's activity, cleared when
  the runtime admits the message or the turn ends.
- Add a failure as a warning that stays visible in the turn; the runtime
  continues without the plugins it could not prepare.
- Only log events that arrive outside a waiting turn, such as preparation
  started by custom agent selection.
Copilot AI balanced review requested due to automatic review settings October 6, 2026 18:37

This comment was marked as outdated.

Describe plugin preparation through the session events Agent Host
receives.
GFM still turns bare URLs, www. addresses and email addresses into links
after markdown escaping. Escape the characters that start them so host
text in the managed plugin and BYOK warnings renders as plain text,
including in the accessible view.
The waiting request's progress row reads the chat's activity, but plugin
preparation progress was published as session activity, which never
reaches it. In a live run the progress event arrived while the turn was
waiting, and the row still showed a generic "Thinking".

Publish the progress as chat activity instead, like worktree creation
progress. Intent, Fusion, and command activity are unchanged.
…xt turn

Plugin preparation for the organization can fail while no message is
waiting, for example after a background policy refresh. Agent Host only
logged those failures, so with retries limited to once an hour the user
would not see the failure until the next retry.

Keep the latest such failure and show it in the next sent turn. Drop it
when a managed_plugins_complete info reports the plugins are ready.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 95d4de1b Current: 501ad9bd

Changed (3)

sessions/chatCompositeBar/MixedStatuses/Light
Before After
before after
sessions/chatCompositeBar/OverflowingTabs/Light
Before After
before after
sessions/sessionChatInputToolbar/SessionChatPills_HorizontalOverflow/Light
Before After
before after

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.

2 participants