• Add editOutcome.jsonl logging for Agent Mode accept / rejects
• Capture original file content before applying changes to enable proper diff tracking
• Fix newline handling in IntelliJ and VS Code to prevent line count discrepancies, was causing lineChange count to be off by one
- Fixed utility functions to find tool calls in correct assistant message instead of last history item
- Enhanced PendingToolCallToolbar to handle individual tool call actions properly
- Added comprehensive tests for multiple tool call scenarios
- Consolidated tool call selectors into single file with cleaner naming
- Added mock support for tools/call endpoint to enable proper testing
- Fixed streamResponseAfterToolCall to wait for all parallel tool calls before continuing
This resolves the issue where accepting/rejecting one tool call would cause other pending tool calls to disappear from the UI.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Key Issues Fixed
### 1. Tool Output Matching Error
- **Problem**: `compileChatMessages` only processed the last tool message, causing "no tool call found to match tool output" errors
- **Solution**: Modified to collect and process all consecutive tool messages from the end
- **Files**: `core/llm/countTokens.ts` - Enhanced tool message collection and validation logic
### 2. Claude API Missing tool_result Blocks
- **Problem**: `flattenMessages` was merging adjacent tool messages, losing individual `toolCallId` properties
- **Solution**: Prevented merging of tool messages to preserve unique `toolCallId` for each `tool_result` block
- **Files**: `core/llm/messages.ts` - Added condition to prevent tool message merging
### 3. Token Counting for Parallel Tool Calls
- **Problem**: Token counting only considered the last tool message
- **Solution**: Added logic to count tokens for all tool messages in parallel scenarios
- **Files**: `core/llm/countTokens.ts` - Enhanced token counting for multiple tool messages
## Test Coverage
- Added comprehensive tests for parallel tool call scenarios
- Tests verify correct message structure for Claude API format
- All existing functionality preserved with backward compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove findCurrentToolCall and replace with parallel-aware alternatives
- Add hasCurrentToolCalls() for boolean checks
- Add findCurrentToolCallsByStatus() for status-specific filtering
- Add new selectors: selectCurrentToolCalls, selectHasCurrentToolCalls, selectCurrentToolCallsByStatus
- Keep selectCurrentToolCall as legacy selector (returns first tool call)
- Update all imports to use proper selectors
- Comprehensive unit tests with 21 passing tests
- Maintain backward compatibility while enabling parallel tool calls
Key Changes:
- Deprecated single tool call logic in favor of array-based approach
- All utility functions now handle both single and multiple tool call scenarios
- TypeScript compilation clean, all tests passing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>