MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isContextOverflowStatusError

Function isContextOverflowStatusError

packages/kosong/src/errors.ts:167–171  ·  view source on GitHub ↗
(statusCode: number, message: string)

Source from the content-addressed store, hash-verified

165}
166
167export function isContextOverflowStatusError(statusCode: number, message: string): boolean {
168 if (statusCode !== 400 && statusCode !== 413 && statusCode !== 422) return false;
169 const lowerMessage = message.toLowerCase();
170 return CONTEXT_OVERFLOW_MESSAGE_PATTERNS.some((pattern) => pattern.test(lowerMessage));
171}
172
173// Strict providers reject a request whose assistant `tool_use`/`tool_calls` and
174// `tool_result`/`tool` blocks are not correctly paired and adjacent — a missing

Callers 2

classifyApiErrorFunction · 0.90
normalizeAPIStatusErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected