Agent should prevent sending prompts that exceed model context window #54841
bhunt-krs
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Zed's agent panel does not enforce the model's context window limit before sending requests. When a conversation accumulates more tokens than the model supports, Zed sends the full payload anyway, the API rejects it, and the user gets an error. This wastes time and creates a frustrating retry loop.
Current behavior
With Amazon Bedrock and
allow_extended_context: true, the effective limit is 1M tokens. In long agent sessions, Zed repeatedly sends prompts exceeding this limit (1.5M+ tokens against a 1M maximum), resulting in errors like:Zed retries the same oversized prompt multiple times in a row, each time getting the same rejection. The user has no signal that the context is too large until the error appears, and no recourse other than manually starting a new thread.
A secondary issue: the "generate summary" feature uses a separate model call with a 64K token limit and fails silently on long threads (
model_max_prompt_tokens_exceeded). This is tracked in #37025.Expected behavior
Zed should:
max_token_count()for the selected modelRelated issues
allow_extended_contextdoes not update UI context window limit (still shows 200k) #49617 —allow_extended_contextdoes not update UI context window limit (still shows 200k). The gauge is inaccurate, which makes it impossible for users to self-manage context size.Environment
allow_extended_context: true)Beta Was this translation helpful? Give feedback.
All reactions