Skip to content
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 tool result order #1087

Closed
wants to merge 1 commit into from
Closed

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Feb 5, 2025

Fixes #1056

Add checks to ensure tool results are always preceded by tool calls.

  • crates/goose/src/agents/reference.rs

    • Add a check in the reply function to ensure tool results are always preceded by tool calls.
  • crates/goose/src/agents/truncate.rs

    • Add a check in the reply function to ensure tool results are always preceded by tool calls.
  • crates/goose/src/message.rs

    • Add a method to the Message struct to enforce the order of tool calls and results.
  • crates/goose-cli/src/prompt/renderer.rs

    • Add a check in the render function to ensure the order of tool requests and responses.
    • Print an error message if the tool result is not preceded by a tool call.

For more details, open the Copilot Workspace session.

Fixes block#1056

Add checks to ensure tool results are always preceded by tool calls.

* **`crates/goose/src/agents/reference.rs`**
  - Add a check in the `reply` function to ensure tool results are always preceded by tool calls.

* **`crates/goose/src/agents/truncate.rs`**
  - Add a check in the `reply` function to ensure tool results are always preceded by tool calls.

* **`crates/goose/src/message.rs`**
  - Add a method to the `Message` struct to enforce the order of tool calls and results.

* **`crates/goose-cli/src/prompt/renderer.rs`**
  - Add a check in the `render` function to ensure the order of tool requests and responses.
  - Print an error message if the tool result is not preceded by a tool call.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1056?shareId=XXXX-XXXX-XXXX-XXXX).
@michaelneale
Copy link
Collaborator

autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tool result must be preceeded by a tool call
2 participants