Skip to content

agent bakeoff - #335498

Merged
Megan Rogge (meganrogge) merged 121 commits into
microsoft:mainfrom
meganrogge:agents/vscode-issue-335085-implementation
Sep 23, 2026
Merged

Megan Rogge (meganrogge) merged 121 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

Fixes #335085
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/9405

Adds sessions.chat.compareAgents.enabled off by default

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
  • record privacy-safe telemetry for attempt duration, the models used, and the model selected by the Judge; correlate provider-native OTel spans for token analysis
  • 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 Judge result leads with the recommended attempt and rationale. A collapsed Attempt time and token usage disclosure shows each attempt's elapsed time and provider-reported input-plus-output tokens.
  7. Select Focus Winning Session to open the recommended attempt, or use its dropdown to focus another attempt. Selecting the comparison group header opens all available attempts in a tiled grid.

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 telemetry 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

Comparison telemetry records only attempt elapsed time, model configuration, and the Judge selection. Provider-native OTel chat spans supply token consumption for analysis. Neither path records cost or task content.

Comparison telemetry

Comparison telemetry records one elapsed-time event when an attempt's first turn becomes terminal and one model-outcome event after the Judge submits a verdict. Provider-native OTel chat spans carry token usage. The OTel trace anchor and both VS Code events use the same hashed comparison ID and successful-attempt index, so the datasets can be correlated without copying provider token counts into VS Code telemetry. It does not include prompts, responses, diffs, file paths, commands, workspace details, validation outcomes, or cost. Provider IDs are reduced to bounded categories (default-copilot, local-agent-host, remote-agent-host, or other).

Event What we log Why
agents/sessionComparisonAttemptCompleted Hashed comparison ID; attempt index; and elapsed milliseconds from session creation until the first turn becomes terminal. Measure first-turn elapsed time, then join to the model outcome event or provider-native OTel trace by hashed comparison ID and attempt index.
Provider-native OTel chat spans gen_ai.usage.input_tokens and gen_ai.usage.output_tokens on chat spans in the attempt trace; the trace anchor carries the hashed comparison ID and attempt index. Analyze token consumption consistently across Copilot, Claude, and Codex without duplicating provider-owned usage into VS Code telemetry.
agents/sessionComparisonModelOutcome Hashed comparison ID; attempt index and count; bounded provider category, agent ID, and resolved or configured model ID for the attempt; whether the Judge recommended it; and the Judge's bounded provider category, agent ID, and resolved or configured model ID. Measure which model and harness combinations participate in comparisons and their Judge-selection rate, including how results vary by Judge configuration.

Joining the two VS Code events and the provider-native OTel trace supports aggregate questions such as which models are compared most often, which are selected most often by the Judge, and how first-turn time or token consumption correlates with that selection. Because task content is intentionally omitted, these are directional correlations rather than claims about model quality for a particular task category.

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

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.

@anthonykim1

Anthony Kim (anthonykim1) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

four substantive gaps and would not approve the current head (6b7a1cc256) yet. The earlier lifecycle-test requests are mostly addressed, but several failure and cleanup paths remain uncovered.

  1. Medium — failed or deleted participants can permanently brick the comparison.
    sessionComparisonService.ts:225 treats any synthesis participant as success, even when creation returned undefined and it only has launchError. sessionComparisonResult.ts:134 then disables the button and labels it “Synthesis Started.” Judge creation has the same problem at sessionComparisonService.ts:309. Deleting an attempt before judging also leaves a missing session with a non-terminal status, so the Judge never starts. These paths lack focused tests.

  2. Medium — successful comparisons have no retirement or cleanup lifecycle.
    _removeComparison is only used when fewer than two attempts launch. Normal session deletion and deleteGroup remove sessions or membership but never remove the persisted comparison. Full prompts and verdicts therefore remain indefinitely, and the deleted group can no longer receive future Judge/synthesis sessions.

  3. Medium — the result surface drops most structured evidence.
    sessionComparisonResult.ts:75 renders the winner explanation and other-attempt strengths but ignores validation, validationSource, unresolvedIssues, conflicts, and persisted usage from the verdict contract. The result test populates these fields without verifying that users can review them.

  4. Medium — a successful verdict is not write-once.
    completeAttemptComparison accepts every valid invocation, while submitVerdict overwrites the existing verdict and clears any synthesis plan. Prompt guidance not to submit twice is not enforcement; a duplicate call can silently change the recommendation and erase user selections.

Additional gap: partially failed comparisons are misleading in the result UI. Failed-launch attempts are excluded from the Judge verdict but included among “other attempts,” where they appear as “No distinct strong points reported” rather than showing their launch failure.

(Generated by Copilot)

@meganrogge
Megan Rogge (meganrogge) force-pushed the agents/vscode-issue-335085-implementation branch from a254912 to 033fdb1 Compare September 15, 2026 20:40
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 <[email protected]>
Preserve comparison configuration and provenance, make comparison evidence and controls accessible, normalize worktree changes, and add lifecycle regression coverage.

Co-authored-by: Copilot <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Copilot-Session: ae987bcc-580a-4ea6-8789-828cf5d1d6fa
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 <[email protected]>
Constrain the element measured by DomScrollableElement so additional attempt rows activate the custom scrollbar.\n\nCo-authored-by: Copilot <[email protected]>
Ensure setup groups, result actions, and compact comparison attempts expose names that match their visible presentation.

Co-authored-by: Copilot <[email protected]>
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 <[email protected]>
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 <[email protected]>

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.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 539210bd-556f-4d13-b55a-b9f0615b613d
roblourens
roblourens previously approved these changes Sep 23, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 539210bd-556f-4d13-b55a-b9f0615b613d
roblourens
roblourens previously approved these changes Sep 23, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 539210bd-556f-4d13-b55a-b9f0615b613d
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 539210bd-556f-4d13-b55a-b9f0615b613d
@meganrogge
Megan Rogge (meganrogge) merged commit d838bdb into microsoft:main Sep 23, 2026
33 checks passed
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
This reverts the portions of commit d838bdb that apply cleanly.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
Preserve changes that landed after #335498 while removing the comparison-specific code from the conflicted Agent Host and Sessions surfaces.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
Preserve changes that landed after #335498 while removing comparison-specific code from the conflicted Agent Host and Sessions surfaces. Keep the Git remote state contract consumed by later multi-folder work and reconcile affected test infrastructure.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
Preserve changes that landed after #335498 while removing comparison-specific code from the conflicted Agent Host and Sessions surfaces. Keep the Git remote state contract consumed by later multi-folder work and reconcile affected test infrastructure.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
This reverts the portions of commit d838bdb that apply cleanly.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
Preserve changes that landed after #335498 while removing comparison-specific code from the conflicted Agent Host and Sessions surfaces. Keep the Git remote state contract consumed by later multi-folder work and reconcile affected test infrastructure.

Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Sep 24, 2026
Preserve changes that landed after #335498 while removing comparison-specific code from the conflicted Agent Host and Sessions surfaces. Keep the Git remote state contract consumed by later multi-folder work and reconcile affected test infrastructure.

Co-authored-by: Copilot <[email protected]>
Megan Rogge (meganrogge) pushed a commit that referenced this pull request Sep 24, 2026
* Revert "agent bakeoff (#335498)"

This reverts the portions of commit d838bdb that apply cleanly.

Co-authored-by: Copilot <[email protected]>

* sessions: Resolve agent bakeoff revert conflicts

Preserve changes that landed after #335498 while removing comparison-specific code from the conflicted Agent Host and Sessions surfaces. Keep the Git remote state contract consumed by later multi-folder work and reconcile affected test infrastructure.

Co-authored-by: Copilot <[email protected]>

* Fix tabbed model picker call sites

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Anthony Kim <[email protected]>
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

agent-bakeoff Issues related to parallel agent execution flow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents window: Compare multiple implementation attempts

8 participants