Skip to content

Terminal command edits are silently ignored when using Claude Agent SDK (works correctly with regular Copilot) #293310

@dias-yegizekov

Description

@dias-yegizekov
  • Copilot Chat Extension Version: 0.37.1
  • VS Code Version: 1.109.0
  • OS Version: Windows_NT x64 10.0.26200 using WSL2 Ubuntu
  • Feature: Claude Agent SDK integration
  • Selected model: Claude Opus 4.5

Description
When an agent proposes a terminal command, VS Code shows a prompt allowing the user to edit the command before executing. This works correctly in regular Copilot sessions — the edited command runs and the agent receives the edited output. However, when using Claude Agent SDK as the agent provider, user edits to the proposed command are silently ignored: the original agent-proposed command runs regardless, and the agent never sees the user's changes.

Steps to Reproduce:

  1. Open VS Code with Copilot extension (latest stable)
  2. Switch to Claude Agent SDK as the agent provider
  3. Start a task that causes the agent to run a terminal command (e.g., echo "Hello")
  4. When the command approval prompt appears, edit the command (e.g., change to echo "Stop")
  5. Click "Allow" to execute

Expected Behavior

  • The edited command (echo "Stop") runs in the terminal
  • The agent sees the edited command and its output
  • Agent note appears: "Note: The user manually edited the command to echo 'Stop'..."
  • This is how it works in regular Copilot sessions and is documented behavior that agents rely on for user steering.

Actual Behavior

  • The original agent-proposed command (echo "Hello") runs instead
  • User edits are silently discarded
  • The agent has no awareness that the user attempted to modify the command

Real-World Impact
This is a significant workflow limitation. Users often edit terminal commands to:

  • Steer the agent when it's about to do something slightly wrong
  • Inject feedback mid-execution (e.g., editing echo "" to echo "stop, fix X first")
  • Correct paths or flags before execution
    Without this working, users lose a key interactive control mechanism and must wait for the agent to finish before providing feedback.

Concrete Example
During a multi-agent workflow, a subagent started reading irrelevant files. The user edited a terminal command to echo "End task" to signal the agent to stop. The edit was ignored — the original command ran, and the agent continued processing unrelated files, wasting context and tokens.

Notes

  • Regular Copilot agent sessions handle command edits correctly
  • This appears specific to the Claude Agent SDK integration path
  • The edit UI prompt appears and accepts input, so the user believes their edit was applied

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugchat-terminalThe run in terminal tool in chat

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions