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

Context Length Exceeded #903

Open
swamikevala opened this issue Jan 29, 2025 · 2 comments
Open

Context Length Exceeded #903

swamikevala opened this issue Jan 29, 2025 · 2 comments
Assignees
Labels
bug Something isn't working p0 v1.0 priority

Comments

@swamikevala
Copy link

After receiving this error, the only option seems to be starting a new session, and re-establishing the context.
Would be better if goose could do one of the following:

  1. Keep attempting to truncate more
  2. Rewrite the context from scratch by looking at the user's initial input, and subsequent inputs (to understand what the user wants), and analyzing the code so far, and rewriting the context based on both
  3. Tell the user the context has become too long and he should start a new session with fresh context
2025-01-29T16:01:52.464018Z  WARN goose::agents::truncate: Context length exceeded. Truncation Attempt: 3/3.
    at crates/goose/src/agents/truncate.rs:237

Error: Context length exceeds limits even after multiple attempts to truncate.
@kalvinnchau
Copy link
Collaborator

Are you using the latest stable release? We recently added a change in #849 to limit to try to get goose to be smarter about how it handles larger files.

And can you provide a bit more context in what you were doing?

1, and 3 are some low-hanging fruit, another potential option for 1 is to make # of attempts user configurable.

as for 2, that'll require some larger though

@kalvinnchau kalvinnchau self-assigned this Jan 29, 2025
@salman1993 salman1993 added the p0 v1.0 priority label Jan 29, 2025
@meenalc meenalc added the bug Something isn't working label Jan 30, 2025
@kalvinnchau
Copy link
Collaborator

kalvinnchau commented Jan 30, 2025

#915, to address some bugs in token counting, and some better error messaging to the user

You can get the latest canary version via

curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CANARY=true bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p0 v1.0 priority
Projects
None yet
Development

No branches or pull requests

4 participants