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

tool result must be preceeded by a tool call #1056

Open
salman1993 opened this issue Feb 3, 2025 · 1 comment · May be fixed by #1087
Open

tool result must be preceeded by a tool call #1056

salman1993 opened this issue Feb 3, 2025 · 1 comment · May be fixed by #1087
Assignees
Labels
bug Something isn't working

Comments

@salman1993
Copy link
Collaborator

Describe the bug
tool result must be preceeded by a tool call

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Image

Please provide following information:

  • OS & Arch: [e.g. Ubuntu 22.04 x86]
  • Interface: UI
  • Version: [e.g. v1.0.2]
  • Extensions enabled: tavily
  • Provider & Model: Google

Additional context
Add any other context about the problem here.

@salman1993 salman1993 added the bug Something isn't working label Feb 3, 2025
@salman1993
Copy link
Collaborator Author

jasonkneen added a commit to jasonkneen/goose that referenced this issue Feb 5, 2025
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).
@jasonkneen jasonkneen linked a pull request Feb 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants