Repository navigation
fix(ai): classify gateway configured input limit overflow - #56454
rudycelekli wants to merge 2 commits into
Conversation
Signed-off-by: Rudy Celekli <[email protected]>
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The fix works. With the mock-gateway reproduction from #56296, the base returns the 400 and never sends a compaction request. With this change, the same 400 is followed by compaction requests, which matches the existing prompt is too long path. The packages/ai tests and typecheck pass, and the new classifier test fails on the base.
The pattern is specific enough. It doesn't run into exclusions or the payload-too-large patterns, and other unsupported_request errors, such as the text-only attachment rejection, are still not treated as context overflow.
Public API: unchanged.
The pattern plus the small case in provider-error.test.ts is enough. The extra end-to-end test in openai-compatible-chat.test.ts checks nothing the classifier test doesn't already cover, so it can be dropped to keep the change minimal.
Signed-off-by: Rudy Celekli <[email protected]>
Issue for this PR
Fixes #56296
Type of change
What does this PR do?
Recognizes the Go gateway's “This text request is too large for the model's configured input limit” error as context overflow, so it reaches the existing compaction recovery path. Other
unsupported_requesterrors, including unsupported attachments, keep their existing classification. Model catalog limits are unchanged.How did you verify your code works?
bun run checkpass. Initial and final full-index patches match the submitted patch byte for byte.Screenshots / recordings
Not applicable; provider error classification only.
Checklist
Independently reviewed before publication.