Conversation
…t arrives for pending tool - Track pendingConfirmationCallId in AgentToolInvocation to properly clear stale prompts - Clear pendingConfirmation when TOOL_RESULT arrives for the pending tool (IDE diff-tab path) - Clear pendingConfirmation via onConfirm callback (terminal UI path) - Ensure pendingConfirmation is NOT cleared when TOOL_RESULT is for a different tool - Prefer filePath over fileName for diff content path in Session and SubAgentTracker - Add comprehensive tests for IDE diff-tab and terminal UI confirmation flows Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
📋 Review SummaryThis PR addresses issue #1203 by fixing a bug where subagent-triggered IDE diff tabs remain stuck waiting for confirmation after the user accepts/rejects changes in the IDE. The implementation tracks pending confirmation tool calls and clears them when the matching 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
TLDR
Fix the issue where subagent-triggered IDE diff tabs remain stuck waiting for confirmation after the user accepts or rejects the change in the IDE.
This also ensures diff content prefers
filePathso both IDE and terminal confirmation flows can continue correctly.Dive Deeper
This change has two main parts:
Track the pending confirmation tool call in
packages/core/src/tools/agent.ts.When the matching
TOOL_RESULTarrives, clearpendingConfirmationimmediately. This covers the IDE diff-tab acceptance path, which can bypass the UIonConfirmwrapper.Prefer
filePathoverfileNamewhen building diff content in the ACP integration layer.This updates both
SessionandSubAgentTrackerso the IDE receives the correct path information when available.The change also adds regression tests for both confirmation paths:
pendingConfirmationafter IDE diff-tab acceptancependingConfirmationafter terminal inline confirmationpendingConfirmationwhen a different tool result arrivesfilePathand fall back tofileNamewhen neededReviewer Test Plan
Local verification:
npm run lint --workspace=packages/corenpm run lint --workspace=packages/clinpm run typecheck --workspace=packages/corenpm run typecheck --workspace=packages/clinpm run test --workspace=packages/core -- src/tools/agent.test.tsnpm run test --workspace=packages/cli -- src/acp-integration/session/SubAgentTracker.test.tsnpm run build --workspace=packages/corenpm run build --workspace=packages/cliTesting Matrix
Linked issues / bugs
Fixes #1203