-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix task execution in VS Code LM API #1496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix task execution in VS Code LM API #1496
Conversation
Fixes RooCodeInc#1488 Update `src/api/providers/vscode-lm.ts` to execute tasks when using the VS Code LM API. * **Task Execution Logic**: Add logic to the `createMessage` method to process and execute tool calls. Introduce a new private method `executeToolCall` to handle the execution of tool calls. * **Error Handling**: Add error handling for invalid tool call parameters and ensure the process continues even if one tool call fails. * **Text and Tool Call Handling**: Modify the `completePrompt` method to handle both text and tool call chunks, executing tasks as needed. Add `src/api/providers/vscode-lm.test.ts` to test task execution in the `createMessage` and `completePrompt` methods. * **Test Cases**: Add test cases to verify task execution, tool call handling, and error handling in the `createMessage` and `completePrompt` methods. * **Mock Implementations**: Use mock implementations for VS Code LM API interactions to simulate different scenarios and validate the new logic. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/RooVetGit/Roo-Code/issues/1488?shareId=XXXX-XXXX-XXXX-XXXX).
|
src/api/providers/vscode-lm.ts
Outdated
| yield { | ||
| type: "text", | ||
| text: toolCallText, | ||
| text: toolResult, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tool call processing block now executes the tool call and yields its result (line 444–449). However, the tests for createMessage expect the yielded text to be the serialized JSON of the tool call. Please reconcile this discrepancy so that either the implementation or the test expectations match the intended behavior.
| text: toolResult, | |
| text: toolCallText, |
…ecution and tool calls * **`src/api/providers/vscode-lm.ts`** - Update `createMessage` method to include logic for executing tasks and process tool calls - Ensure tool call processing block yields serialized JSON of the tool call - Update `completePrompt` method to handle task execution * **`src/api/providers/__tests__/vscode-lm.test.ts`** - Add test cases to verify task execution in `createMessage` and `completePrompt` methods - Update test cases to expect serialized JSON of the tool call
* **Task Execution Tests** - Add test cases to verify task execution in the `createMessage` method - Add test cases to verify task execution in the `completePrompt` method * **Tool Call Tests** - Update test cases to expect the serialized JSON of the tool call
… call in result string * Serialize the tool call to JSON and append it to the result string in the `completePrompt` method
|
@Harrison-Idornigie did you intend to close this? |
|
@hannesrudolph yes i think it fixed itself. maybe an api issue or something |
Fixes #1488
Update
src/api/providers/vscode-lm.tsto execute tasks when using the VS Code LM API.createMessagemethod to process and execute tool calls. Introduce a new private methodexecuteToolCallto handle the execution of tool calls.completePromptmethod to handle both text and tool call chunks, executing tasks as needed.Add
src/api/providers/vscode-lm.test.tsto test task execution in thecreateMessageandcompletePromptmethods.createMessageandcompletePromptmethods.For more details, open the Copilot Workspace session.
Important
Fix task execution in VS Code LM API by adding tool call handling and error management.
createMessageinvscode-lm.tsto process and execute tool calls.executeToolCallmethod to handle tool call execution.createMessageandcompletePrompt.completePromptto handle text and tool call chunks, executing tasks as needed.vscode-lm.test.tsto test task execution increateMessageandcompletePrompt.This description was created by
for 9312001. It will automatically update as commits are pushed.