Skip to content

Don't reuse a remembered remote agent host session type when this window lacks the host - #345156

Merged
Connor Peet (connor4312) merged 2 commits into
mainfrom
copilot/fix-new-chat-editor-error
Oct 30, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
mainfrom
copilot/fix-new-chat-editor-error

Conversation

Copilot AI commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

chat.userSelectedSessionType is stored per profile, so a session type for a remote agent host (remote-*) chosen in one window carries over to windows that don't have that host. In those windows Chat: New Chat Editor reuses it and opens a broken untitled-<uuid> editor: no chat editor is registered for that scheme, so the text model resolver fails with Unable to resolve resource.

Changes

  • isNewChatSessionTypeUsable (chat/common/constants.ts): a remote-* type now also requires a registered chat session contribution in this window. Remote hosts register one per connected agent. If it's missing, the remembered selection falls back to the computed default.
    if (isAgentHostTarget(sessionType)) {
    	return agentHostEnabled && (!isRemoteAgentHostTarget(sessionType) || !!chatSessionsService.getChatSessionContribution(sessionType));
    }
    Local agent host types (agent-host-*) are unchanged and stay usable before their contribution registers.
  • Test (constants.test.ts): covers a remembered remote type both without and with a registered contribution.

Note for review

A remote type is now unusable until its host connects and registers, even in a window that does have the host. A New Chat Editor opened before that point uses the computed default instead of the remembered remote type.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 10:02

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Copilot AI changed the title [WIP] Fix new Chat Editor resource resolution error Don't reuse a remembered remote agent host session type when this window lacks the host Oct 30, 2026
@connor4312
Connor Peet (connor4312) marked this pull request as ready for review October 30, 2026 15:41
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) October 30, 2026 15:41
@connor4312
Connor Peet (connor4312) merged commit c71aad2 into main Oct 30, 2026
55 checks passed
@connor4312
Connor Peet (connor4312) deleted the copilot/fix-new-chat-editor-error branch October 30, 2026 18:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 30, 2026
Ross Wollman (rwoll) added a commit that referenced this pull request Oct 30, 2026
Resolve the conflict in isNewChatSessionTypeUsable with #345156, which now also
rejects a remembered remote Agent Host type this window lacks. Keep that check
unchanged and add the policy check for local Claude/Codex harnesses.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
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.

New Chat Editor fails with 'Unable to resolve resource' when the remembered remote agent host is not available

6 participants