Skip to content

OS toast notification shows wrong terminal command when multiple tool invocations in response #309576

@meganrogge

Description

@meganrogge

Bug

When a chat response contains multiple terminal tool invocations, the OS notification toast shows the command from the first terminal invocation (which may have already completed) rather than the one actually waiting for confirmation.

Repro

  1. Start a session where the agent runs multiple terminal commands sequentially
  2. The first command (e.g. git status --short) completes and the agent moves on
  3. A later command (e.g. a complex npx playwright test ... invocation) requires user confirmation
  4. The OS toast notification fires but displays the first command (git status --short) instead of the pending one

Cause

_getPendingTerminalCommand in chatWindowNotifier.ts iterates over all response parts and returns the first toolInvocation with toolSpecificData.kind === 'terminal' — it does not check whether that invocation is actually in WaitingForConfirmation or WaitingForPostApproval state.

Fix

Filter to only match tool invocations whose state is WaitingForConfirmation or WaitingForPostApproval, consistent with what _confirmAllow already does.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugchatchat-terminalThe run in terminal tool in chatinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions