Local fork of continuedev/continue for auto-approve and full-access mode experiments
Find a file
Patrick Erichsen a9e3a56a61 Fix parallel tool calls core processing and Claude API compatibility
## 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>
2025-07-08 21:18:48 -07:00
.continue Merge branch 'main' into nate/clean-gui 2025-07-03 19:06:22 -07:00
.github ci: add link to recommended extension for conv commits 2025-07-07 12:49:03 -07:00
.idea Merge pull request #5637 from continuedev/pe/jb-tool-msg-fontsize-fix 2025-05-16 13:24:43 -07:00
.vscode chore: terminate all tasks after debug 2025-07-02 19:37:33 +05:30
binary package updates 2025-07-03 12:29:47 -07:00
core Remove backward compatibility check in addToolCallDeltaToState 2025-07-08 15:37:23 -07:00
docs Merge branch 'main' into bdougie/mcp-cwd 2025-07-07 11:43:55 -07:00
eval Preview (#1750) 2024-07-28 23:16:18 -07:00
extensions support secretAccessKey and accessKeyId for bedrock 2025-07-07 18:47:37 -07:00
gui Fix parallel tool calls core processing and Claude API compatibility 2025-07-08 21:18:48 -07:00
manual-testing-sandbox add next edit test cases 2025-06-24 18:13:15 -07:00
media update run configs 2024-10-23 16:50:15 -07:00
packages Merge pull request #6505 from continuedev/dallin/config-yaml-96 2025-07-08 08:44:47 -07:00
scripts Fix install-all-dependencies script 2025-07-02 23:05:16 -04:00
sync merkel 2024-10-23 10:29:15 +02:00
.continueignore ignore .continue folder 2025-03-08 16:18:51 -08:00
.eslintrc.shared.json add no misused promises rule 2025-06-13 22:09:32 +05:30
.gitignore Merge branch 'main' into watsonx-vi 2025-05-29 10:05:58 -07:00
.node-version Update Node.js LTS to v20.19.0 2025-04-22 02:01:03 +08:00
.nvmrc Update Node.js LTS to v20.19.0 2025-04-22 02:01:03 +08:00
.prettierignore add to prettierignore 2025-05-25 18:40:42 -07:00
.prettierrc remove border above input box 2024-11-05 08:18:31 -08:00
CODE_OF_CONDUCT.md npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path . 2025-05-25 18:41:32 -07:00
CONTRIBUTING.md update contributing to install vite 2025-06-11 17:48:30 -07:00
LICENSE Create LICENSE 2023-06-03 09:29:19 +02:00
package-lock.json remove global jsdom dep 2025-06-26 14:40:07 -07:00
package.json remove global jsdom dep 2025-06-26 14:40:07 -07:00
README.md npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path . 2025-05-25 18:41:32 -07:00
SECURITY.md Create SECURITY.md 2025-02-01 01:01:08 -08:00
tsconfig.json .continuerules 2024-12-15 09:30:56 -08:00

Continue logo

Continue

Continue enables developers to create, share, and use custom AI code assistants with our open-source VS Code and JetBrains extensions and hub of models, rules, prompts, docs, and other building blocks

Agent

Agent enables you to make more substantial changes to your codebase

agent

Chat

Chat makes it easy to ask for help from an LLM without needing to leave the IDE

chat

Autocomplete

Autocomplete provides inline code suggestions as you type

autocomplete

Edit

Edit is a convenient way to modify code without leaving your current file

edit

Getting Started

Learn about how to install and use Continue in the docs here

Contributing

Read the contributing guide, and join #contribute on Discord.

License

Apache 2.0 © 2023-2024 Continue Dev, Inc.