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 · 2 comments
Open

tool result must be preceeded by a tool call #1056

salman1993 opened this issue Feb 3, 2025 · 2 comments
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/maverick 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).
@baxen
Copy link
Collaborator

baxen commented Feb 7, 2025

We've seen this before and it is related to the state management in useChat. There are likely some edge cases still remaining. This fixed one class of errors for example #859

@baxen baxen closed this as completed Feb 7, 2025
@baxen baxen reopened this Feb 7, 2025
@wendytang wendytang removed their assignment Feb 10, 2025
ShinnosukeKomiya added a commit to ShinnosukeKomiya/goose_quick_start that referenced this issue Feb 11, 2025
block/goose#1056 のようなissueが発生する
ShinnosukeKomiya added a commit to ShinnosukeKomiya/goose_quick_start that referenced this issue Feb 11, 2025
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.

3 participants