-
Notifications
You must be signed in to change notification settings - Fork 613
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
Sessions fail after viewing more than 5 files with Bedrock provider #1267
Comments
Is the session erroring out? What would be the downside of failing gracefully to avoid a session breaking error? Actually perhaps I don't understand the mechanism of failure -- is it 5+ files all at once in a single request to Bedrock? Or 5+ files throughout the course of a session using Bedrock? We use AWS Bedrock ourselves at Block, so I am surprised haven't heard of this issue before from other users at the company |
Same issue with claude 3.7 and Bedrock, goose 1.0.9, running on Ubuntu.
This error appeared after another context related one (same setup):
Another related problem: adding of unsupported file type (shell script in this case) is also causing the error at the same source location:
This is not a transient problem, it reoccurs after resuming the session. |
Describe the bug
Goose sessions using Bedrock fail after viewing more than 5 files. This happens because Bedrock's API has a hard limit of 5 document attachments per request.
To Reproduce
view
commandExpected behavior
Session should be able to maintain functionality and context while viewing multiple files, working within or around Bedrock's document limit.
Please provide following information:
Additional context
Looking at the Bedrock API docs, this appears to bea core limitation of their API:
The issue seems to be in:
crates/goose-mcp/src/developer/mod.rs
- text_editor_view functioncrates/goose/src/providers/formats/bedrock.rs
- document handlingCurrently I manage this in my goosehints by prompting to
cat
files via the shell tool when looking at more than 5 files. This isn't very robust. When I inevitably hit the issue again, I just open up the session file and manually clean up the history, then prompt to usecat
moving forward.I can think of a couple approaches but I'm not sure which would be best:
Not sure how this works for other providers besides Bedrock and I'm also not totally sure yet what the token usage/cost implications would be of using regular text content vs. document blocks for this.
Happy to attempt a PR with one of the above approaches as well, but very new to this codebase so interested to hear alternative approaches or reasons why either of these proposed solutions are infeasible.
The text was updated successfully, but these errors were encountered: