tweak: add new ContextOverflowError type (#12777)

This commit is contained in:
Aiden Cline
2026-02-08 23:54:01 -06:00
committed by GitHub
parent d40dffb854
commit 99ea1351ce
6 changed files with 350 additions and 126 deletions

View File

@@ -1,4 +1,4 @@
import type { APICallError, ModelMessage } from "ai"
import type { ModelMessage } from "ai"
import { mergeDeep, unique } from "remeda"
import type { JSONSchema7 } from "@ai-sdk/provider"
import type { JSONSchema } from "zod/v4/core"
@@ -824,13 +824,4 @@ export namespace ProviderTransform {
return schema as JSONSchema7
}
export function error(providerID: string, error: APICallError) {
let message = error.message
if (providerID.includes("github-copilot") && error.statusCode === 403) {
return "Please reauthenticate with the copilot provider to ensure your credentials work properly with OpenCode."
}
return message
}
}