Skip to content

sessions: fix Send and chat binding regressions in the shared composer - #343370

Merged
Logan Ramos (lramos15) merged 6 commits into
mainfrom
agents/fix-repo-picker-send-button-sync
Oct 22, 2026
Merged

Logan Ramos (lramos15) merged 6 commits into
mainfrom
agents/fix-repo-picker-send-button-sync

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Fixes regressions from #342683 (the shared composer). The composer now hosts a real ChatWidget bound to a chat model. The previous composer never loaded a chat model before Send.

Changes

Send disabled despite a valid repository choice (Cloud drafts and quick chats)

  • When the draft chat loads, the legacy Copilot Cloud extension seeds repositories: '___vscode_repository_default___'.
  • The chat input's Send action requires chatSessionOptionsValid, which rejects that placeholder, while the Agents window repository picker shows a valid selection.
  • The draft's real selections were only copied into the chat during send, which is too late.
  • Fix: chat inputs whose host owns submission (hostSubmit) no longer check option validity (chatInputPart.ts). This restores the pre-Unify new session and active session composer #342683 behaviour, where only the host decided whether Send was enabled. It also covers quick chats, which have no repository to apply.
  • Fix: the Copilot provider applies a draft's selections when its chat model is published, using its existing Cloud chat-model autorun. The chat and extension therefore see the real repository instead of the placeholder or an arbitrary first repository.

Wrong repository id for Cloud drafts

  • RemoteNewSession built the repositories option id from the workspace root path, so it was owner/repo/HEAD. The extension saved that as a recently selected repository.
  • Fix: use the draft's repoNwo (owner/repo).

In-session composer bound to the wrong chat with several chats open

  • NewChatInSessionWidget bound and sent to sessionsService.activeSession.activeChat. With two chat groups, focusing an existing chat rebound the other group's new-chat composer to it. _bindModel then overwrote that chat's draft text and attachments.
  • Fix: NewChatView.setChat now passes the group's chat to the widget, which hands it to the composer (new optional chat option) and sends to it. The New Session composer still binds its draft through session.activeChat.

Inline references lost when the draft is replaced

  • Binding another draft's chat model, for example after changing the workspace or harness on New Session, replaces the input with that model's state.
  • The composer carried its text and attachments over, but not its inline references (#file: completions). The next parse dropped them, so the prompt was sent as plain text without the file.
  • Fix: _bindModel carries the references over the same way the failed-send restore already does.

Notes for reviewers

  • One shared workbench change: IChatInputHostSubmit now documents that the host decides whether session options are valid. Only Agents window composers use hostSubmit.
  • Known and not changed here: the in-session composer still takes its session from sessionsService.activeSession. With two different sessions side by side, an unfocused session's composer reflects the focused session's settings. This existed before Unify new session and active session composer #342683.
  • No issue is linked; this was reported directly.

How to test

  1. Open the Agents window with Cloud sessions available, choose a GitHub repository on New Session, and reload. Send should stay enabled once the input has text.
  2. Start a Cloud quick chat right after the window opens. Send should be enabled.
  3. In a session, open two chat groups: an existing chat in one and New Chat in the other. Type in each, then switch focus between them. Neither input should change the other's text or attachments, and Send in the new-chat group should go to its own chat.
  4. On New Session, type Fix # and pick a file, then change the workspace. The #file: reference should stay highlighted, and the file should be sent with the request.

Validation

  • ./scripts/test.sh --reporter dot --run src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts --run src/vs/sessions/contrib/chat/test/browser/sharedChatInputComposer.test.ts --run src/vs/sessions/contrib/chat/test/browser/chatView.test.ts --run src/vs/sessions/contrib/chat/test/browser/nestedChatComposer.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatUserInteraction.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts --run src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts --run src/vs/workbench/contrib/chat/test/browser/widget/chatWidget.test.ts --run src/vs/workbench/contrib/chat/test/browser/actions/chatExecuteActions.test.ts: passed (737 passing, 8 pending).
  • Each new regression test failed with its production change reverted and passed with it.
  • npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck (same as npm run typecheck-client): passed.
  • npm run eslint -- <changed files>: passed.
  • Pre-commit hygiene hook: passed.
  • Not run:
    • npm run compile: blocked locally because the installed @github/copilot-sdk (1.0.101) doesn't match copilotRuntimeVersion (1.0.102).
    • Manual Agents window testing of the steps above.
    • Integration and smoke tests.

The shared composer (#342683) hosts a real ChatWidget bound to a chat
model, which the previous composer never loaded before Send.

- Cloud drafts: the legacy extension seeds a "no repository" placeholder
  when the draft chat loads, and the chat input's option validity check
  disabled Send even though the repository picker had a valid choice.
  Inputs whose host owns submission (hostSubmit) no longer check option
  validity, and the Copilot provider applies the draft's selections when
  its chat model is published, not only on send.
- Cloud drafts used `owner/repo/HEAD` as the repository option id, which
  the extension saved as a recently selected repository. Use `owner/repo`.
- With several chat groups open, the in-session new-chat composer bound
  and sent to the session's active chat, overwriting another chat's
  input. It now binds and sends to the chat its own group shows.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 22:19
Binding a new draft's chat model replaces the input with that model's
state. The composer carried its text and attachments over, but not its
inline references (such as `#file:` completions), so the next parse
dropped them and the prompt was sent as plain text without the file.
Carry the references over as the failed-send restore already does.

Co-authored-by: Copilot <[email protected]>

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
What changed in this PR

Fixes regressions introduced by the shared chat composer by ensuring the composer binds to the correct chat model and that Send enablement/option propagation behaves correctly for Cloud drafts, quick chats, and multi-chat scenarios.

Changes:

  • Adjusts Send enablement so hostSubmit hosts don’t gate Send on session option validity.
  • Ensures Copilot Cloud drafts apply their selected session options when the chat model is published (not only on send).
  • Fixes in-session “New Chat” composer to bind/send to the correct chat when multiple chats are open, and preserves inline file references across model rebinds.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatInputPart.test.ts Adds coverage for host-submitted inputs bypassing session option validity checks.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Skips option-validity gating when hostSubmit is present; clarifies interface docs.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​copilotChatSessionsProvider.test.ts Adds test ensuring draft repository selection is applied when chats load with placeholders.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​copilotChatSessionsProvider.ts Applies draft-selected options when chat models are published; fixes repository id source for drafts.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sharedChatInputComposer.test.ts Adds tests for binding precedence (host chat vs active chat) and preserving inline references.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​newChatUserInteraction.test.ts Updates harness to include _chat observable for new composer routing.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​nestedChatComposer.test.ts Adds coverage ensuring send targets the composer’s chat even if another chat is active.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​chatView.test.ts Verifies view wires per-chat composer configuration including explicit chat binding.
src/​vs/​sessions/​contrib/​chat/​browser/​sharedChatInputComposer.ts Refactors chat model binding and preserves inline references on model changes.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatInSessionWidget.ts Introduces explicit chat binding so composer doesn’t follow activeChat from other groups.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatComposerInput.ts Extends composer input options with optional explicit chat observable.
src/​vs/​sessions/​contrib/​chat/​browser/​chatView.ts Wires setChat through to the in-session widget to bind to the correct chat.

Review effort: Lite

Cloud drafts are only created for GitHub repository roots, so `repoNwo`
is always available. The root path fallback could only produce the
`owner/repo/HEAD` form this PR fixes.

Co-authored-by: Copilot <[email protected]>
#343258 made `autoModelFusion` a boolean while #343324 set it to an
object in this fixture, which breaks compilation on main. Same change as
#343376.

Co-authored-by: Copilot <[email protected]>
@lramos15
Logan Ramos (lramos15) marked this pull request as ready for review October 21, 2026 23:26
@lramos15
Logan Ramos (lramos15) enabled auto-merge (squash) October 21, 2026 23:48
@lramos15
Logan Ramos (lramos15) merged commit dfa0c13 into main Oct 22, 2026
59 checks passed
@lramos15
Logan Ramos (lramos15) deleted the agents/fix-repo-picker-send-button-sync branch October 22, 2026 00:02
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 22, 2026
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.

3 participants