Files
vscode/.github
Sandeep Somavarapu 98bf19c30c agent host: fix custom agent selection and per-chat agent/model changes (#322300)
* agent host: fix custom agent selection and per-chat agent/model changes

Two fixes for Copilot CLI agent-host sessions:

- The selected custom agent (e.g. a plugin/extension agent like "Inbox")
  failed with "Custom agent '<name>' not found". The SDK validates the
  session-start `agent:` option against `customAgents` by name and does not
  consult `pluginDirectories`, but file-dir plugin agents were excluded from
  `customAgents`. The new `toSdkSessionCustomAgents` helper force-includes the
  resolved selected agent while other file-dir agents still load via
  `pluginDirectories`.

- An additional (peer) chat in a session did not respect agent/model changes.
  `SessionAgentChanged`/`SessionModelChanged` were dispatched to the session
  URI (the default chat) instead of the per-chat turn channel, and the
  `chatChannel` was dropped before reaching `changeAgent`/`changeModel`. These
  now route to the peer chat's backend conversation in `_chatSessions`.

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

* sessions: address Copilot code review feedback

- Trim SDK custom-agent names to match parseAgentFile so a whitespace-padded
  frontmatter name still matches the resolved selected agent (CCR finding 3).
- Dedup peer-chat agent/model side-channel dispatch against the last value
  sent for that chat (tracked on AgentHostChatSession) instead of the session
  summary, which only exists for the default chat (CCR findings 1 & 2).

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-22 00:02:32 +02:00
..
2026-06-11 23:40:04 +02:00