Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/llm/src/provider-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const patterns = [
/model_context_window_exceeded/i,
/too many tokens/i,
/token limit exceeded/i,
/too many images (?:were )?provided/i,
]

const exclusions = [/^(throttling error|service unavailable):/i, /rate limit/i, /too many requests/i]
Expand Down
1 change: 1 addition & 0 deletions packages/llm/test/provider-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("provider error classification", () => {
"Prompt has 5,958,968 tokens, but the configured context size is 256,000 tokens",
"Too many tokens",
"Token limit exceeded",
"Too many images were provided, we currently limit the number of images per conversation to 60",
]

expect(messages.every(isContextOverflow)).toBe(true)
Expand Down
1 change: 1 addition & 0 deletions packages/opencode/test/session/message-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ describe("session.message-v2.fromError", () => {
"Please reduce the length of the messages or completion",
"400 status code (no body)",
"413 status code (no body)",
"Too many images were provided, we currently limit the number of images per conversation to 60",
]

cases.forEach((message) => {
Expand Down
Loading