Repository navigation
chat: wrap batch image previews with stable row heights - #342116
Merged
Merged
Conversation
Add a default-off user setting and mirror it to Copilot Agent Host sessions on create, resume, and acknowledged live updates without changing image-generation consent. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Companion-runtime availability and end-to-end image-generation acceptance remain unvalidated.
0 open findings
What changed in this PR
Adds an opt-in image watermark preference to Copilot’s Agent Host sessions, independent of image-generation consent.
Changes:
- Registers a default-off, application-scoped setting with best-effort labeling guidance.
- Passes the preference during create/resume and synchronizes live changes through acknowledged updates.
- Adds coverage for defaults, launch reconciliation, and failed-update recovery.
No actionable findings remain.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts | Registers and mirrors the setting. |
| src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts | Covers create/resume preference combinations. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Tests live updates, launch changes, and recovery. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Updates launch-option expectations. |
| src/vs/platform/agentHost/test/common/copilotCliConfig.test.ts | Verifies schema defaults. |
| src/vs/platform/agentHost/node/copilot/copilotSessionWrapper.ts | Records launch-time watermark state. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Supplies watermark options to the SDK. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Synchronizes watermark changes with runtime acknowledgment. |
| src/vs/platform/agentHost/common/copilotCliConfig.ts | Defines the preference and description. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Screenshot ChangesBase: Changed (3)Added (4) |
Keep the selected main image above responsive thumbnail rows with at most five items. Reserve row height while mixed-size images arrive, preserve each tile's natural proportions, and leave unused width outside the tiles rather than cropping or adding bars. Preserve selection and focus, add vertical keyboard navigation, and cover progressive loading with renderer tests and Component Explorer fixtures. Co-authored-by: Copilot <[email protected]>
Keep this branch focused on the batched image preview grid. Move the independent watermark preference and its create, resume, and live-update coverage to #342229. Co-authored-by: Copilot <[email protected]>
Keep the already-validated VS Code main baseline and its image rendering performance fixes while preserving the published PR history. The final feature diff contains only the four batch-grid files; watermark settings now live in #342229. Co-authored-by: Copilot <[email protected]>
Justin Chen (justschen)
added a commit
that referenced
this pull request
Oct 18, 2026
Move the independent watermark setting from #342116 into the image settings PR. Keep the model dropdown and legacy profile migration intact, and register the watermark next to them with its existing default-off semantics. Preserve create, resume, and acknowledged live-update wiring and regression coverage. Add a configuration regression for the relocated setting. Co-authored-by: Copilot <[email protected]>
Justin Chen (justschen)
marked this pull request as ready for review
October 18, 2026 03:23
Justin Chen (justschen)
enabled auto-merge (squash)
October 18, 2026 03:23
Bhavya U (bhavyaus)
approved these changes
Oct 18, 2026
Justin Chen (justschen)
added a commit
that referenced
this pull request
Oct 21, 2026
…ed image paths (#342229) * chat: pick the image generation model from a dropdown The Copilot runtime now serves GPT Image 2.5 Flare instead of GPT Image 2.5 Sunburst (github/copilot-agent-runtime#27192), at unchanged rates. Replace the chat.copilot.imageGeneration.enabled boolean with a chat.copilot.imageGeneration.model dropdown offering Off and GPT Image 2.5 Flare. Each model's option lists its rates in its markdown description, so the Settings dropdown and settings.json completions show the cost of the model being chosen. The runtime serves one image model and its SDK session options take no model, so the dropdown still mirrors the boolean imageGeneration root key, and older and remote Agent Hosts need no change. Only a listed model turns the key on. Off, retired models such as gpt-image-2.5-sunburst, and any other value turn it off, because the mirror checks only the setting's type and an unknown string must not enable whatever model the runtime serves. The host key's description no longer names a model: it is published to AHP clients and cannot know which model the runtime serves. The legacy boolean migrates to the dropdown (true to Flare, false to Off) unless the new setting is already set, and is always removed. Defaults are unchanged: Flare in Insiders, Off elsewhere. Co-authored-by: Copilot <[email protected]> * chat: migrate the legacy image setting while another profile is active With a non-default profile active, VS Code reads and writes a setting in the default profile's settings only if the registry knows the setting is application-scoped. Unregistering chat.copilot.imageGeneration.enabled hid its value there, so the migration never ran: the user's choice was ignored, and the new setting fell back to its default, which is GPT Image 2.5 Flare in Insiders even for users who had turned image generation off. Keep the legacy boolean registered as a deprecated application setting. The Settings editor hides it unless it is configured, and the migration can now read it from, and remove it in, the default profile's settings. A test with a non-default profile checks the actual settings files. Co-authored-by: Copilot <[email protected]> * chat: include watermark preference with image model settings Move the independent watermark setting from #342116 into the image settings PR. Keep the model dropdown and legacy profile migration intact, and register the watermark next to them with its existing default-off semantics. Preserve create, resume, and acknowledged live-update wiring and regression coverage. Add a configuration regression for the relocated setting. Co-authored-by: Copilot <[email protected]> * agentHost: give the agent the path of each generated image The runtime's image_generation tool tells the agent only an image_id, so an agent asked to put the image in the workspace searched the session folder, found no file, and extracted the image from events.jsonl. The Copilot CLI saves generated images in the session folder, but only for its "Open image" link, so its agents aren't told the path either. CopilotAgentSession's post-tool-use hook now saves each generated image where the CLI does, <session folder>/images/image-<hash>.png, and adds a "path:" line after its "image_id:" line in the tool result. The runtime passes SDK callback hooks the full tool result, including the image bytes, and applies modifiedResult before the model sees it, so the file exists when the agent gets its path. Only images whose bytes match their image_id are saved; names match the CLI's (pinned to its test vector), so a session opened in both reuses one file; a different file at the path is left alone; and a deleted session folder is never recreated. toSdkHooks now returns VS Code's own post-tool-use output instead of dropping it, combined with plugin hooks' output, and plugin hooks see the result VS Code changed, as the runtime orders successive hooks. A provider integration test has the synthetic model call the real runtime's image tool and checks the saved file and the path the model receives; without this change the model gets only the image_id. Co-authored-by: Copilot <[email protected]> * agentHost: describe why the session config requires both image options The pinned Copilot SDK now declares the watermark option, so the old note about it missing from the SDK type projection was stale. The local interface only makes both options required for the finalize step. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
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.
Summary
Replace the scrolling thumbnail strip for batched image-generation results in chat with a wrapping, aspect-aware grid. The final feature diff contains only the batch renderer, its CSS, renderer tests, and generated-image fixtures.
Runtime dependency
No new runtime version, Agent Host setting, or SDK option is required for this layout change; it uses the existing batch-result contract.
The watermark setting has been removed from this PR and moved into #342229 alongside the image-model dropdown. This grid PR is independent of that PR's pending runtime release/version-bump requirements.
The branch retains the previously validated
mainbaseline661e013024d, including its image-rendering performance fixes. The approved four grid files are byte-identical to the previous rebased implementation; the split preserves published history without a force push.Validation
Commands ran from the grid worktree after removing watermark wiring and restoring the validated main baseline:
npm run build-fast -- --client-only— passed.npm run typecheck-client— passed.git diff --cached --check— passed before the final commit.Final four-file hygiene — passed:
TypeScript and CSS lint — both passed:
Baseline Agent Host and full chat-renderer suites — 3,048 passing, two existing pending:
Existing grid regression fails without the implementation and passes with it. Coverage includes less than one CSS pixel of row-height drift during sequential image completion at 360, 760, and 1,000-pixel container widths, natural tile aspect ratios, no internal overflow, wrapping, and keyboard focus.
Scripted Component Explorer validation of the unchanged grid completed ten mixed-size images with zero row-height drift and no overflow. After the split, the preview was reloaded and again showed two rows of five thumbnails with no overflow or error overlay.
Automated checks use synthetic images and make no live image-generation requests.
Manual testing
BatchGridLoadingfixture in Component Explorer and use Complete Next Image; also inspectBatchGridandBatchGridNarrow.