MCPcopy Index your code
hub / github.com/anomalyco/opencode / isContextOverflowFailure

Function isContextOverflowFailure

packages/llm/src/provider-error.ts:29–32  ·  view source on GitHub ↗
(failure: unknown)

Source from the content-addressed store, hash-verified

27 patterns.some((pattern) => pattern.test(message)) || /^4(00|13)\s*(status code)?\s*\(no body\)/i.test(message)
28
29export const isContextOverflowFailure = (failure: unknown) =>
30 failure instanceof LLMError
31 ? failure.reason._tag === "InvalidRequest" && failure.reason.classification === "context-overflow"
32 : Schema.is(ProviderErrorEvent)(failure) && failure.classification === "context-overflow"

Callers 1

llm.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected