Skip to content

Conversation

@Harrison-Idornigie
Copy link

@Harrison-Idornigie Harrison-Idornigie commented Mar 8, 2025

Fixes #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.


Important

Fix task execution in VS Code LM API by adding tool call handling and error management.

  • Task Execution Logic:
    • Update createMessage in vscode-lm.ts to process and execute tool calls.
    • Add executeToolCall method to handle tool call execution.
  • Error Handling:
    • Add error handling for invalid tool call parameters in createMessage and completePrompt.
    • Ensure process continues if a tool call fails.
  • Text and Tool Call Handling:
    • Modify completePrompt to handle text and tool call chunks, executing tasks as needed.
  • Testing:
    • Add vscode-lm.test.ts to test task execution in createMessage and completePrompt.
    • Include test cases for task execution, tool call handling, and error handling.
    • Use mock implementations for VS Code LM API interactions.

This description was created by Ellipsis for 9312001. It will automatically update as commits are pushed.

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).
@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2025

⚠️ No Changeset found

Latest commit: a1d06a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 8, 2025
yield {
type: "text",
text: toolCallText,
text: toolResult,
Copy link
Contributor

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.

Suggested change
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
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Mar 8, 2025
@Harrison-Idornigie Harrison-Idornigie deleted the fix-task-execution branch March 8, 2025 22:48
@hannesrudolph
Copy link
Collaborator

@Harrison-Idornigie did you intend to close this?

@Harrison-Idornigie
Copy link
Author

@hannesrudolph yes i think it fixed itself. maybe an api issue or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roo has stopped executing tasks

2 participants