Roo-Code/src
Roo Code 40d6b5e3c1 fix(vscode-lm): add tool call/result sequence validation
Fixes #10843

The VSCode Language Model API requires that when an Assistant message
contains LanguageModelToolCallPart(s), the immediately next message MUST
be a User message with LanguageModelToolResultPart(s) with matching callIds.

This commit adds a validateAndRepairToolSequence function that:
- Identifies assistant messages with tool calls
- Checks that the next message is a user message with matching tool results
- Adds placeholder ToolResultParts for any missing tool results
- Creates user messages with placeholder results when no user message follows

This fixes the 'Invalid request: Tool call part must be followed by a User
message with a LanguageModelToolResultPart with a matching callId' error
that occurs when using MCP servers (like JIRA/Confluence) with the vscode-lm
provider in versions after 3.36.
2026-01-21 09:12:24 +00:00
..
__mocks__ Add timeout to OpenAI Compatible Provider Client (#9898) 2025-12-08 17:36:53 -08:00
__tests__ chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
activate Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
api fix(vscode-lm): add tool call/result sequence validation 2026-01-21 09:12:24 +00:00
assets Show the Roo provider on the welcome screen (#8317) 2025-09-25 16:13:04 -04:00
core chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
extension feat: streaming tool stats + token usage throttling (#9926) 2025-12-08 19:40:12 -08:00
i18n feat: add OpenAI Codex provider with OAuth subscription authentication (#10736) 2026-01-14 23:48:51 -05:00
integrations chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
services chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
shared chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
types feat(proxy): add debug-mode proxy routing (#10467) 2026-01-06 13:17:50 -07:00
utils chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
workers Count tokens worker (#3037) 2025-04-29 12:29:25 -07:00
.gitignore PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
.prettierignore PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
.vscodeignore debug: Add ErrorBoundary component for better error handling (#5085) 2025-07-23 08:45:35 -04:00
esbuild.mjs feat(proxy): add debug-mode proxy routing (#10467) 2026-01-06 13:17:50 -07:00
eslint.config.mjs Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
extension.ts Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.ca.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.de.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.es.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.fr.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.hi.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.id.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.it.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.ja.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.ko.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.nl.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.pl.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.pt-BR.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.ru.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.tr.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.vi.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.zh-CN.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
package.nls.zh-TW.json Git worktree management (#10458) 2026-01-20 13:39:24 -08:00
tsconfig.json Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
turbo.json Improve turbo task dependency declarations (#4323) 2025-06-04 09:32:27 -07:00
vitest.config.ts Show console logging in vitests when the --no-silent flag is set (#7467) 2025-08-28 12:51:21 -04:00
vitest.setup.ts Show console logging in vitests when the --no-silent flag is set (#7467) 2025-08-28 12:51:21 -04:00