Skip to content

sessions: add agent attempt comparisons - #335498

Draft
Megan Rogge (meganrogge) wants to merge 37 commits into
microsoft:mainfrom
meganrogge:agents/vscode-issue-335085-implementation
Draft

Megan Rogge (meganrogge) wants to merge 37 commits into
microsoft:mainfrom
meganrogge:agents/vscode-issue-335085-implementation

Conversation

@meganrogge

@meganrogge Megan Rogge (meganrogge) commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator
Image

Summary

  • add Run Multiple Agents... to the agent picker behind the off-by-default sessions.chat.compareAgents.enabled experiment
  • configure independent attempts with provider-local agents and models, including repeated agent/model combinations with stable attempt IDs
  • preserve setup selections while the picker is dismissed and clear them only after a successful submission
  • launch attempts directly in isolated worktrees, then run a visible Judge after the attempts finish
  • require the Judge to review every diff, inspect available evidence, and run missing targeted validation without modifying attempts
  • persist provider-neutral token summaries and privacy-safe telemetry/OTel correlation while keeping usage out of Judge evidence
  • present a recommendation-first comparison result with explicit review, synthesis, and cleanup actions

UX

  1. Select Run Multiple Agents... in the agent picker.
  2. Add or remove attempt rows and choose an agent and provider-local model for each attempt.
  3. Optionally expand Evaluation to choose the Judge agent and model.
  4. Select Run N Attempts. Each attempt runs in parallel in its own isolated worktree.
  5. The comparison parent summarizes progress and becomes Comparison · Review ready when the Judge submits a verdict.
  6. The comparison grid leads with the recommended attempt, explanation, validation provenance, and conflicts.
  7. Select Review Recommended Attempt to open that attempt and its Changes editor. This records the reviewed selection but does not apply or merge changes.

The prompt and attached context are frozen when the comparison launches. Judge recommendations remain advisory. Synthesis and worktree cleanup are always explicit, and no attempt is automatically applied or deleted.

Reviewer notes

Comparison records are provider-neutral and persisted in profile storage. Setup is represented as an array of uniquely identified attempts rather than a map keyed by harness, allowing different models from one harness or repeated runs of the same configuration.

Model identifiers remain provider-local and the UI displays provider-owned model labels. There is intentionally no equivalent-model-across-providers behavior.

Attempts, the Judge, and explicit synthesis are ordinary sibling sessions in one comparison group. The Judge is the automatic machine-review stage; Review Recommended Attempt is the explicit human verification stage. New verdicts distinguish attempt-reported validation, Judge-run validation, and unavailable evidence. Existing persisted verdicts remain compatible.

Validation

  • npm run transpile-client
  • npm run typecheck-client
  • targeted ESLint and repository stylelint for changed Sessions files
  • npm run valid-layers-check
  • focused comparison tool, orchestration, sidebar, setup, accessibility, and usage tests
  • live Agents window validation with a persisted completed comparison
  • git diff --check

Fixes #335085

Architecture flow

flowchart LR
    Setup[Choose attempt agents/models<br/>and Judge] -->|Run in parallel| Attempts[Attempts<br/>isolated worktrees]
    Attempts -->|All terminal| Judge[Judge session<br/>review every diff]
    Judge -->|1. readAttemptComparison| Evidence[Bounded cross-attempt manifest]
    Evidence -.->|2. get_session_context<br/>for deeper transcript evidence| Judge
    Judge -.->|3. targeted tests/build/lint<br/>when evidence is missing| Validation[Validation evidence]
    Validation --> Judge
    Judge -->|4. completeAttemptComparison<br/>exactly once| Results[Recommendation<br/>provenance and conflicts]
    Results -->|Review Recommended Attempt| Review[Attempt session<br/>and Changes editor]
    Results -->|Optional| Synthesis[Synthesis session]
Loading

Token usage stays out of Judge evidence; privacy-safe telemetry and OTel correlation are recorded separately.

Judge tools

Tool What it does Added for this flow?
readAttemptComparison Gives the Judge one bounded manifest of every attempt, worktree, changed file summary, and exact transcript target. Yes
get_session_context Lets the Judge inspect one attempt conversation when deeper evidence is needed. No, reused an existing tool
standard validation tools Let the Judge run missing targeted tests, builds, lint, or diagnostics in the attempt worktrees. No, reused existing tools
completeAttemptComparison Records one structured recommendation, conflicts, per-attempt findings, validation states, and evidence provenance. Yes

Add a multi-harness comparison workflow with isolated child sessions, provider-owned shared-model resolution, visible judging, evidence review, synthesis, and explicit cleanup.\n\nFixes microsoft#335085\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 10, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Provenance restoration, file-overlap calculation, composer configuration forwarding, accessibility, layout, and test coverage need correction.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 7 Medium severity · 1 Low severity

New issues introduced by this change (8)
Severity Finding
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts — Setting a visible label here does not resize the existing send control:…
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatWidget.ts — The launch drops two values that this PR defines as shared: neither the composer's selected branch…
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatWidget.ts — All coordinator/provider/worktree failures reach this catch, but they are only logged, so the user…
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​sessionTypePicker.ts — When a provider omits the optional pre-creation snapshot API, modelResolution is undefined and…
Medium severity src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​copilotChatSessionsProvider.ts — This map only preserves provenance for the lifetime of the provider. After a window/provider reload…
Medium severity src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparisonEditor.ts — This new focusable, information-rich editor has no editor-focused accessibility help provider,…
Medium severity src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparisonEditor.ts — These keys are absolute paths inside each attempt's isolated worktree. The same repository-relative…
Low severity src/​vs/​sessions/​services/​sessions/​browser/​sessionComparisonService.ts — There are no focused tests for this new lifecycle service, despite neighboring Sessions browser…
What changed in this PR

Adds provider-neutral multi-agent attempt comparisons to the Agents window.

Changes:

  • Adds multi-harness comparison selection and shared-model validation.
  • Orchestrates isolated attempts, judging, synthesis, persistence, and cleanup.
  • Adds a comparison editor plus provider provenance/model-discovery support.
File Description
src/​vs/​sessions/​sessions.common.main.ts Loads comparison contributions and service.
src/​vs/​sessions/​SESSION_COMPARISONS.md Documents comparison architecture and lifecycle.
src/​vs/​sessions/​services/​sessions/​common/​sessionsProvider.ts Extends provider creation and model-discovery contracts.
src/​vs/​sessions/​services/​sessions/​common/​sessionsManagement.ts Adds parent-session creation provenance.
src/​vs/​sessions/​services/​sessions/​common/​sessionComparison.ts Defines comparison models and service API.
src/​vs/​sessions/​services/​sessions/​browser/​sessionsManagementService.ts Forwards session provenance to providers.
src/​vs/​sessions/​services/​sessions/​browser/​sessionComparisonService.ts Implements orchestration, persistence, synthesis, and cleanup.
src/​vs/​sessions/​README.md Links the comparison specification.
src/​vs/​sessions/​contrib/​sessionComparison/​common/​sessionComparison.ts Defines the comparison-opening command.
src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparisonTool.ts Adds the Judge verdict tool.
src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparisonEditorInput.ts Adds restorable comparison editor input.
src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparisonEditor.ts Renders evidence and comparison actions.
src/​vs/​sessions/​contrib/​sessionComparison/​browser/​sessionComparison.contribution.ts Registers editor, tool, command, and setting.
src/​vs/​sessions/​contrib/​sessionComparison/​browser/​media/​sessionComparisonEditor.css Styles the comparison editor.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​copilotChatSessionsProvider.test.ts Tests Copilot provenance and model discovery.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​copilotChatSessionsProvider.ts Implements Copilot provenance and creation-time models.
src/​vs/​sessions/​contrib/​providers/​agentHost/​test/​browser/​localAgentHostSessionsProvider.test.ts Tests Agent Host provenance and models.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​baseAgentHostSessionsProvider.ts Forwards provenance and exposes creation models.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionTypePicker.ts Adds comparison mode and multi-selection.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Documents comparison keyboard interaction.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatWidget.ts Launches comparisons from the composer.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts Supports dynamic attempt-count send labels.
build/​lib/​i18n.resources.json Registers comparison localization resources.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/sessions/contrib/chat/browser/newChatInput.ts
Comment thread src/vs/sessions/contrib/chat/browser/newChatWidget.ts Outdated
Comment thread src/vs/sessions/contrib/chat/browser/newChatWidget.ts
Comment thread src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts Outdated
Comment thread src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonEditor.ts Outdated
Comment thread src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonEditor.ts Outdated
Preserve comparison configuration and provenance, make comparison evidence and controls accessible, normalize worktree changes, and add lifecycle regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Format comparison sources, preserve provider option shapes when provenance is absent, and compare persisted creation references through their public URI representation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Represent comparisons as uniquely identified attempts with provider-local model selection. Add a focused setup dialog, shared-context and usage disclosures, and keep synthesis explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Improve the parallel-attempt setup and comparison hierarchy, add structured Judge evidence and verdict tools, and record provider-neutral token usage with OTel correlation.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the Judge review every attempt and record validation provenance, then surface a recommendation-first result with explicit human review routing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open live attempt sessions in an adaptive grid while work is active, then return to the standard comparison editor when all attempts are terminal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Load Judge instructions from a packaged prompt, open the comparison when judging completes, and present a winner-focused result with deterministic synthesis evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep comparison participants visually connected, preserve progress visibility, hide stale details on participant navigation, and place winner/synthesis actions at the end of completed results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Choose comparison grid columns from the number of active attempts so four sessions form a 2x2 grid, six form 3x2, and nine form 3x3. Keep phone layouts in a single column.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Replace the standalone comparison editor with a participant grid and a Judge-owned result card. Keep custom dialog controls in the keyboard focus loop so attempt agent and model selectors are operable without a mouse.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show Judge and synthesis before attempt sessions in both the list and tiled grid. Keep group connector decoration limited to implementation attempts.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Constrain the element measured by DomScrollableElement so additional attempt rows activate the custom scrollbar.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure setup groups, result actions, and compact comparison attempts expose names that match their visible presentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make attempt validation use authoritative worktrees, represent inapplicable validation explicitly, and allow rejected verdicts to be corrected. Repair the affected test and fixture infrastructure exposed by CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevent verdict submission failures caused by models mistyping or combining participant and session UUIDs. Map manifest attempt numbers back to internal participant IDs when persisting the verdict.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Let the Judge identify semantic implementation decisions, allow users to choose an attempt per section, and pass the persisted plan to the isolated synthesis session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Show only the agent and model in synthesis approach selectors while keeping stable attempt numbers in the Judge contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Show comparison attempts by agent and model across session titles, pane headers, sidebar rows, and Judge results. Migrate untouched legacy generated titles while retaining stable attempt numbers in the Judge protocol.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Give parallel participant chats the full Sessions area by hiding the editor only after the comparison grid opens successfully.

Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Keep the parallel-agent workflow discoverable when the selected workspace cannot create isolated worktrees, and rely on progress indicators instead of redundant working/completed labels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the latest synthesis and comparison-grid work while retaining persistent action discoverability and spinner-only attempt progress.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Format the comparison evidence mapping and make its worktree path assertion platform-native.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject unusable comparison launches, preserve frozen permissions for Judge and synthesis sessions, restore telemetry coverage, and remove comparison APIs without production callers. Fix the comparison setup regression test so it exercises an eligible session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep concurrent attempt results widened to the persisted participant contract so launch-threshold checks typecheck.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
Fall back to the selected workspace repository branch when Agent Host creation config has not resolved yet, so Execute Parallel Agents opens its setup dialog instead of refocusing the workspace picker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents window: Compare multiple implementation attempts

3 participants