Skip to content

Agent sessions approval row - #298929

Merged
Benjamin Christopher Simmonds (benibenj) merged 4 commits into
mainfrom
benibenj/resonant-hummingbird
Mar 3, 2026
Merged

Agent sessions approval row#298929
Benjamin Christopher Simmonds (benibenj) merged 4 commits into
mainfrom
benibenj/resonant-hummingbird

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

Copilot Generated Description: Introduce an approval row for agent sessions, allowing for user confirmation on tool invocations. This includes updates to the session model and rendering logic to support the new approval feature.

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.

Pull request overview

Adds an “approval row” UI to Agent Sessions so users can explicitly confirm pending tool invocations, backed by a new per-session approval-tracking model.

Changes:

  • Introduces AgentSessionApprovalModel to derive per-session approval info (label/language + confirm action) from live chat tool-invocation state.
  • Updates the agent sessions tree renderer + delegate to render the approval row and adjust row height dynamically.
  • Adds component fixtures and a dedicated unit test suite for the approval model; enables the feature in the Sessions window.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/agentSessionsViewer.fixture.ts Adds visual fixtures covering many session variants, including approval-row examples.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionApprovalModel.test.ts Unit tests for approval derivation across tool invocation states and data variants.
src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css Styles for the new approval row UI.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts Renders approval row, emits height-change events, and supports dynamic item height.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts Wires approval model into the sessions tree and updates row height when approval visibility changes.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.ts New model that tracks “needs approval” state per session via observables.
src/vs/sessions/contrib/sessions/browser/sessionsViewPane.ts Enables the approval row in the Sessions window.

Comment thread src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@benibenj

Copy link
Copy Markdown
Contributor Author

Copilot i forgot to correctly adjust this test, can you adjust it so it passes again. It should be expecting sh and not bash

  1. AgentSessionApprovalModel
    handles legacy terminal tool data:

    • expected - actual

    {
    "label": "legacy-cmd"

    • "language": "sh"
    • "language": "bash"
      }

AssertionError: {"label":"legacy-cmd","language":"sh"} deepStrictEqual {"label":"legacy-cmd","language":"bash"}

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Benjamin Christopher Simmonds (@benibenj) I've opened a new pull request, #298933, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* fix: update test expectation for legacy terminal tool data to expect 'sh' language id

Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 41054e8 into main Mar 3, 2026
20 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the benibenj/resonant-hummingbird branch March 3, 2026 12:06
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants