Skip to content

Agents window: cannot reference another session from the active chat input #346531

Open

Description

@torerik81

In the Agents window, the chat input of an active chat offers no working way to reference another session. The "Sessions..." picker is empty, #session completion has no suggestions, and pasting a session link leaves plain text. Users expect a session reference to appear as an attachment pill, the same way session links appear in agent responses.

Environment

  • VS Code Insiders 1.146.0-insider, commit d9cccdd (2026-11-06)
  • Windows
  • Agents window, local Agent Host Copilot CLI sessions (frontend resources agent-host-copilotcli:/<id>, backend resources ahp-session:/<id>)

Steps to reproduce

  1. Open an existing chat in the Agents window. Click Add Context (+) > "Sessions...". The picker (placeholder "Select a session") shows only "Go back", although the sidebar lists several local sessions.
  2. In the same input, type #ses and press Ctrl+Space. The suggest widget shows "No suggestions."
  3. Use "Copy Link" on a session in the sidebar and paste the link (vscode-insiders://agents/agent-host-session/ahp-session/<uuid>) into the input. It stays as plain text, and no attachment or pill is created.

Expected

Each of these lets the user attach another session as a session reference, shown as an attachment pill.

Root cause analysis (main)

  • SessionReferenceContextPickerPick in src/vs/workbench/contrib/chat/browser/actions/chatContext.ts lists sessions from IChatSessionsService.getChatSessionItems([Local, Background, AgentHostCopilot]). In the Agents window, AgentHostSessionListContribution (src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.ts) returns early with if (this._isSessionsWindow) return;, so it never registers the agent host session item controllers. The picker is therefore always empty there. The workbench #session: completion in src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts reads the same empty source.
  • The Agents window has its own SessionReferenceCompletions (src/vs/workbench/contrib/sessions/browser/chat/sessionReferenceCompletions.ts, restored in sessions: restore #session references for /troubleshoot in the composer #343378), which reads ISessionsManagementService. It is wired only into SharedChatInputComposer, which newChatWidget.ts and newChatInSessionWidget.ts use. The active chat input in ChatView (src/vs/workbench/contrib/sessions/browser/chat/chatView.ts) is a regular ChatWidget input and does not get it.
  • chatPasteProviders.ts turns only GitHub issue and pull request URLs into attachments. No paste provider handles agent-host-session links.

Suggested fixes

  • Make "Sessions..." and #session in the Agents window read from ISessionsManagementService, or add SessionReferenceCompletions to the active chat input.
  • Add a paste provider that turns agent-host-session links into session reference attachments.

Related: #323969 tracks how referenced sessions become model-readable attachments across session types. This issue covers the input entry points in the Agents window.

Activity

  1. added
    stale
    on Nov 13, 2026
  2. alexdima commented on Nov 28, 2026

    @alexdima
    Member

    I tried this on VS Code Insiders 1.147.0-insider (macOS), signed in, in the Agents window, with three local sessions in the sidebar:

    The clip below shows all three. I'm keeping this open for the picker and the #session completion.

    346531-sessions-picker-and-hash-full.mp4

    🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).

  3. added
    bug
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agents-windowbugchat-inputstaletriage-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions