Skip to content

Conversation

@katzdave
Copy link
Collaborator

@katzdave katzdave commented Oct 3, 2025

Remove orphaned tool calls before compaction. Also add in fix_conversation to catch other potential conversation errors.

Main branch version: #4987

info!("Removing last assistant message with pending tool request before compaction");
messages_to_process.remove(last_assistant_pos);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just call the conversation fixer here to be safe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try that; would be nice to not have to add new logic.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could possibly help with some other corner cases like if there's an empty message in there during streaming that we recently saw. maybe also change the type here to conversation from Vec - fixes some of that too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah doesn't quite have this new logic so keeping both, but threw it in too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that you have the conversation fixer I don't think you need this check

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't handle the visible/non-visible messages now but added some logic for that.

@katzdave
Copy link
Collaborator Author

katzdave commented Oct 3, 2025

OK have this pretty extensively tested new. The new logic consistently triggers and haven't seen the orphaned tool call error after maxing out the context window on 10 sessions.

@katzdave katzdave marked this pull request as ready for review October 3, 2025 16:36
@katzdave katzdave requested a review from a team as a code owner October 3, 2025 16:41
@katzdave katzdave changed the base branch from release/1.9.1 to main October 3, 2025 16:41
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://block.github.io/goose/pr-preview/pr-4968/

Built to branch gh-pages at 2025-10-03 16:43 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@katzdave katzdave force-pushed the dkatz/rm-orphaned-tool-calls branch from 2402e5a to 4930d9d Compare October 3, 2025 17:39
@katzdave katzdave changed the base branch from main to release/1.9.1 October 3, 2025 17:39
…orphaned-tool-calls

* 'release/1.9.2' of github.com:block/goose:
  Fix auto scroll to bottom during chat (#4923)
  fix redirect to extensions page after deeplink install and show toast with success message (#4863)
  added claude-sonnet-4-5 (#4906)
  Upgrade electron for macOS Tahoe compatibility (#5015)
  chore(release): release version 1.9.2
@katzdave katzdave changed the base branch from release/1.9.1 to release/1.9.2 October 6, 2025 18:30
@katzdave katzdave requested a review from jamadeo October 6, 2025 19:28
@katzdave katzdave merged commit 2b275d6 into release/1.9.2 Oct 7, 2025
5 checks passed
@katzdave katzdave deleted the dkatz/rm-orphaned-tool-calls branch October 7, 2025 22:31
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.

4 participants