Repository navigation
sessions: restore #session references for /troubleshoot in the composer - #343378
Merged
Merged
Conversation
#342683 replaced the Agents window composer input and dropped its `#session` completions. The workbench completions it now relies on skip agent-host chats, such as Copilot CLI sessions, and reference a session resource that the sessions management service does not resolve. So `/troubleshoot #session:<title>` could no longer point the skill at another session's event log. Provide `#session` completions in the shared composer again, listing the Copilot CLI sessions on the composer session's host. Accepting one adds an inline reference whose value the troubleshoot augmentation resolves. 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
Restores #session completions in the Agents window composer so /troubleshoot can target another Copilot CLI session’s event log by inserting an inline #session:<title> reference.
Changes:
- Adds
SessionReferenceCompletionsto provide#sessionsuggestions scoped to the composer’s input model and host. - Wires the completions into
SharedChatInputComposer. - Introduces browser tests covering listing behavior and end-to-end resolution via
getSessionReferenceResource.
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/browser/sharedChatInputComposer.ts | Registers the new SessionReferenceCompletions for the composer widget. |
| src/vs/sessions/contrib/chat/browser/sessionReferenceCompletions.ts | Implements #session completion provider and insertion via ChatDynamicVariableModel. |
| src/vs/sessions/contrib/chat/test/browser/sessionReferenceCompletions.test.ts | Adds coverage for listing, scoping, and resolution of inserted session references. |
Review effort: Lite
…hem to the input model - Filter on the inserted `#session:<title>` text. The `#session <title>` filter text had no `:`, so the editor hid every suggestion once `#session:` was typed. - Offer completions only for the composer's own input model, not any model that shares its resource. 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]>
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
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.

Restores
#sessionreferences in the Agents window composer, which #342683 dropped. Related to #343370, which fixes the other regressions from that PR; the two are independent.Problem
The previous composer input registered
SessionReferenceCompletionHandler. Typing#sessionlisted the Copilot CLI sessions on the same host. Picking one attached a session-reference marker thatSessionsManagementService._augmentOptionsForTroubleshootresolves, so/troubleshootcould read another session'sevents.jsonl.#342683 replaced that input with
SharedChatInputComposer(a workbenchChatWidget) and deleted the handler. The workbench's own#sessioncompletion can't stand in for it:#sessioncompletions at all.URIvalue), whichgetSessionReferenceResourcedoesn't recognise.So
/troubleshoot #session:<title>silently fell back to the current session's log.Change
SessionReferenceCompletions(sessionReferenceCompletions.ts), registered bySharedChatInputComposerfor its own input model only.#session:<title>reference through the chat input'sChatDynamicVariableModel. The input decorates it, removes it when the text is deleted, and turns it into a request attachment whose value is the existingcreateSessionReferenceVariableEntrymarker._augmentOptionsForTroubleshootresolves that marker unchanged.sessionsService.activeSession.How to test
/troubleshoot #sess. The other sessions on the same host are listed.events.jsonlinSession log:.Validation
./scripts/test.sh --reporter dot --run src/vs/sessions/contrib/chat/test/browser/sessionReferenceCompletions.test.ts --run src/vs/sessions/contrib/chat/test/browser/sharedChatInputComposer.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatUserInteraction.test.ts --run src/vs/sessions/contrib/chat/test/browser/chatView.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts --run src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts: passed (667 passing, 2 pending).#session:<title>still matches;#, other variables, other inputs, non-CLI sessions and no session produce nothing;getSessionReferenceResource.npm run eslint -- <changed files>: passed.npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck: passed. This needed the one-linetabbedModelPicker.fixture.tsfix for the type break currently onmain; it's identical to Fix compile break in tabbed model picker fixture #343376, so whichever lands first, the other merges cleanly.npm run compile: blocked locally by a Copilot SDK version mismatch innode_modules.