microsoft / microsoft/vscode

Agent Sessions: clicking inline tool-result images opens sidecar tab instead of Image Carousel

Open
#325,684 1 comment 0 reactions 1 assignee Claimed by @justschen View on GitHub
bug ux
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Version
VS Code Insiders 1.129.0-insider (commit e8a3eada3426fa6848c7494ebe2291702fef4a61), macOS arm64

### Steps to Reproduce

1. Open an **Agent Sessions** window (the newer background/CLI agent session UI, distinct from the classic in-editor Copilot Chat panel).
2. Have the agent run a tool that produces an image file on disk (e.g. a file-viewing tool, or a screenshot generated via a local Playwright script) and reference it in the response.
3. Confirm `imageCarousel.chat.enabled` is `true` (it defaults to `true` in this build; the current docs at https://code.visualstudio.com/docs/agents/reference/ai-settings list the default as `false`, so there may also be a docs/build drift worth noting).
4. Reload the window to ensure the setting is freshly applied.
5. Click the inline image that was rendered in the Agent Sessions transcript.

### Expected

The image opens in the enlarged Image Carousel view (`workbench.action.chat.openImageInCarousel`), consistent with how tool-result image pills behave in the classic Copilot Chat view (see #318289, where `imageCarousel.chat.enabled` was confirmed as the supported way to view attached/tool images inline).

### Actual

The image renders inline correctly, but clicking it always opens a plain sidecar editor tab instead of the carousel — reproduced twice with two independently generated PNGs (one from a file-viewing tool, one from a locally-run Playwright script saved to the real filesystem). This was consistent before and after a full window reload with the setting explicitly pinned `true` in `settings.json`.

### Investigation notes

Looking at the compiled `vs/sessions/sessions.desktop.main.js` bundle, the carousel click-wiring (`_renderImagePills`, `chatImageCarouselService.openCarouselAtResource`, `chat-inline-anchor-widget`) appears to require the image to arrive as part of a native `toolInvocation` result shaped like `{ kind: "data", mimeType: "image/...", ... }` (built via `toolResultToIO`), or as a markdown anchor link pointing at an image URI recognized by that same widget. Tool images surfaced through the CLI/agent runtime into the Agent Sessions view appear to take a different rendering path that isn't wired to `chatImageCarouselService`, so the pill/click-to-enlarge behavior never triggers even though the setting and underlying service are active.

Given the maintainer guidance in #318289 pointed to this setting as the general solution, it'd be good to confirm whether Agent Sessions is expected to support the same behavior, or whether this is a known gap in that newer surface.

### Does this issue occur when all extensions are disabled?
Yes (reproduced with only built-in extensions; no third-party chat/image extensions installed)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.