sessions: don't flash input needed for auto-approved tools#325679
Open
benibenj wants to merge 4 commits into
Open
sessions: don't flash input needed for auto-approved tools#325679benibenj wants to merge 4 commits into
benibenj wants to merge 4 commits into
Conversation
When a session runs with bypass approvals, client-contributed tools (e.g. the browser tools) briefly showed the session as `input needed` in the sessions window before clearing on their own. Auto-approved calls transition through PendingConfirmation and Running while the owning client auto-approves and runs them, and both host-owned status paths surfaced that as InputNeeded. Skip the session `inputNeeded` queue entries and demote the aggregated chat-summary status for tool calls flagged `autoApproveBySetting`, scoped to the parameter-confirmation gate so a genuine PendingResultConfirmation still surfaces. Fixes #325631 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents auto-approved client tools from briefly marking Agent sessions as needing input.
Changes:
- Suppresses session input requests for auto-approved parameter confirmations and execution.
- Corrects summarized chat status while preserving genuine confirmations.
- Adds coverage for auto-approved and result-confirmation flows.
Show a summary per file
| File | Description |
|---|---|
agentSideEffects.ts |
Filters auto-approved tool input requests. |
sessionState.ts |
Projects auto-approved confirmations as in progress. |
agentSideEffects.test.ts |
Tests session input-request behavior. |
chatSummaryStatus.test.ts |
Tests summary status projection. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 6
- Review effort level: Medium
Only demote InputNeeded to InProgress when an auto-approved pending confirmation is actually present and no genuine blocker exists, so a restored summary with no loaded active turn keeps its InputNeeded status. Condense verbose comments per review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Thanks for the review — addressed in 2e17211:
|
meganrogge
previously approved these changes
Jul 13, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…using-the-browser-tools-in-the-agent # Conflicts: # src/vs/platform/agentHost/node/agentSideEffects.ts
pwang347
approved these changes
Jul 13, 2026
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.
Fix
When a session runs with bypass approvals (
autoApprove) in the Agents/sessions window, client-contributed tools (e.g. the browser tools) briefly flashed the session as input needed in the sessions list, then cleared on their own without any user action.Root cause
Auto-approved client tools deliberately transition through
PendingConfirmation— the host tags the tool call_meta.autoApproveBySetting = true, and the owning client auto-approves and runs it. During that auto-approval round-trip + client-side execution, the session was reported asInputNeededthrough two host-owned paths:agentSideEffects._syncToolInputNeededpushed aToolConfirmationentry (duringPendingConfirmation) and aToolClientExecutionentry (duringRunning) into the sessioninputNeededlist.chatSummaryFromStatereportedInputNeededfor aPendingConfirmationtool call; the sessions list aggregates this.The generated protocol reducers (
channels-*/reducer.ts) are synced from the siblingagent-host-protocolrepo and must not be hand-edited, so the fix lives in the two host-owned touch points.Changes
agentSideEffects.ts:_syncToolInputNeededskips both theToolConfirmationandToolClientExecutionsessioninputNeededentries for a tool call flaggedautoApproveBySetting.sessionState.ts:chatSummaryFromStatedemotes anInputNeededstatus caused solely by auto-approved confirmations back toInProgress(preservingIsRead/IsArchivedflags).Both are scoped to the parameter confirmation gate (
PendingConfirmation) only — a genuine post-executionPendingResultConfirmationstill surfaces as input needed even when the parameter gate was auto-approved.Notes for reviewers
_setSessionInputNeeded: by definition they don't block the session on user input, so the 5-minute "blocked past threshold" telemetry doesn't apply (execution time is still captured on completion viatoolInvoked).ChatState.statusfrom the generated reducer still momentarily readsInputNeededfor a full-chat subscriber during the sub-second auto-approval window; the sessions list (which drives the reported badge) is fixed here. The reducer-level change belongs in theagent-host-protocolrepo.Tests
agentSideEffects.test.ts: auto-approved tool produces no sessioninputNeededentry; a genuine result confirmation still surfaces.chatSummaryStatus.test.ts(new): spuriousInputNeededdemoted toInProgress; genuine / mixed / result-confirmation cases preserved.Fixes #325631