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

feat: add a truncating agent #579

Merged
merged 9 commits into from
Jan 15, 2025
Merged

feat: add a truncating agent #579

merged 9 commits into from
Jan 15, 2025

Conversation

laanak08
Copy link
Collaborator

@laanak08 laanak08 commented Jan 13, 2025

Adds an agent that handles exceeding the context token-limit by truncation, where truncation is implemented as de-queuing the earliest messages from conversation history until total history is under the context limit.
an error is returned if truncation completes and no history remains, or the user is actively attempting to send a message that by-itself is too large.

accessible via
cargo run --bin goose --session --agent truncate

@laanak08 laanak08 changed the base branch from main to v1.0 January 13, 2025 17:24
@laanak08 laanak08 changed the title Feat: add a truncating agent feat: add a truncating agent Jan 13, 2025
Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

@laanak08 laanak08 requested a review from zakiali January 13, 2025 18:40
Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

Copy link
Collaborator

@ahau-square ahau-square left a comment

Choose a reason for hiding this comment

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

I wonder whether upon truncation we should maintain a user or assistant message at the front with something like "Our previous conversation history has been truncated up this point." since messages might get chopped at unintuitive points.

In testing have you found that the model seems able to still function coherently even when early history is truncated?

crates/goose/src/agents/truncate.rs Outdated Show resolved Hide resolved
crates/goose/src/agents/truncate.rs Outdated Show resolved Hide resolved
Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

@laanak08 laanak08 merged commit ee0359a into v1.0 Jan 15, 2025
6 checks passed
salman1993 added a commit that referenced this pull request Jan 16, 2025
* origin/v1.0:
  feat: add a truncating agent (#579)
  feat: Release devtools opening keyboard shortcut when goose window is not focused (#614)
  feat: performance tweaks for partial release (#611)
  Alexhancock/inline code (#612)
  feat: add more tracing logs, trim loaded prompt  (#603)
  feature: new welcome page and real keychain  (#604)
  fix: model names in UI API key warning (#609)
  feat: map non-ok responses from provider to human readable error msgs (#610)
  fix: update BufReader capacity to 2MB (#605)
  fix: escape double quotes in error part (#602)
  refactor: remove unused errors in mcp-client (#598)
  add more context from mcp server errors (#599)
  fix: error formatting for vercel data format (#597)
  feat: Add endpoint to store secrets in keychain (#595)
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.

2 participants