Repository navigation
sessions: fix Send and chat binding regressions in the shared composer - #343370
Merged
Logan Ramos (lramos15) merged 6 commits intoOct 22, 2026
Merged
Conversation
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]>
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]>
Contributor
There was a problem hiding this comment.
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
hostSubmithosts 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]>
…r-send-button-sync
#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]>
Logan Ramos (lramos15)
marked this pull request as ready for review
October 21, 2026 23:26
Justin Chen (justschen)
approved these changes
Oct 21, 2026
Logan Ramos (lramos15)
enabled auto-merge (squash)
October 21, 2026 23:48
Logan Ramos (lramos15)
deleted the
agents/fix-repo-picker-send-button-sync
branch
October 22, 2026 00:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes regressions from #342683 (the shared composer). The composer now hosts a real
ChatWidgetbound 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)
repositories: '___vscode_repository_default___'.chatSessionOptionsValid, which rejects that placeholder, while the Agents window repository picker shows a valid selection.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.Wrong repository id for Cloud drafts
RemoteNewSessionbuilt the repositories option id from the workspace root path, so it wasowner/repo/HEAD. The extension saved that as a recently selected repository.repoNwo(owner/repo).In-session composer bound to the wrong chat with several chats open
NewChatInSessionWidgetbound and sent tosessionsService.activeSession.activeChat. With two chat groups, focusing an existing chat rebound the other group's new-chat composer to it._bindModelthen overwrote that chat's draft text and attachments.NewChatView.setChatnow passes the group's chat to the widget, which hands it to the composer (new optionalchatoption) and sends to it. The New Session composer still binds its draft throughsession.activeChat.Inline references lost when the draft is replaced
#file:completions). The next parse dropped them, so the prompt was sent as plain text without the file._bindModelcarries the references over the same way the failed-send restore already does.Notes for reviewers
IChatInputHostSubmitnow documents that the host decides whether session options are valid. Only Agents window composers usehostSubmit.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.How to test
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).npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck(same asnpm run typecheck-client): passed.npm run eslint -- <changed files>: passed.npm run compile: blocked locally because the installed@github/copilot-sdk(1.0.101) doesn't matchcopilotRuntimeVersion(1.0.102).