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

Instead of erroring on context length exceeded after 3 attempts, ask the user what to do #1096

Open
salman1993 opened this issue Feb 5, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@salman1993
Copy link
Collaborator

Currently, we try to attempt truncation 3 times with 90%, 80%, 70% msgs - then fail.

Error: Context length exceeds limits even after multiple attempts to truncate. 

Instead, we can ask the user whether we should attempt futher truncation OR to exit so that user can start a fresh session if they want

@salman1993 salman1993 added the enhancement New feature or request label Feb 5, 2025
jasonkneen added a commit to jasonkneen/maverick that referenced this issue Feb 6, 2025
Fixes block#1096

Add user prompt for further truncation or exit when context length exceeds limits.

* Modify `crates/goose-cli/src/prompt.rs` to add `TruncateFurther` variant to `InputType` enum and `Input` struct, and add `ask_user_for_truncation` function to `Prompt` trait.
* Modify `crates/goose/src/agents/extension.rs` to update `ContextLimit` error to include user prompt.
* Add test cases in `crates/goose/tests/providers.rs` for user prompt on context length exceeded, including scenarios for further truncation and exit.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1096?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant