MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isPromptTooLongMessage

Function isPromptTooLongMessage

src/services/api/errors.ts:64–77  ·  view source on GitHub ↗
(msg: AssistantMessage)

Source from the content-addressed store, hash-verified

62export const PROMPT_TOO_LONG_ERROR_MESSAGE = 'Prompt is too long'
63
64export function isPromptTooLongMessage(msg: AssistantMessage): boolean {
65 if (!msg.isApiErrorMessage) {
66 return false
67 }
68 const content = msg.message.content
69 if (!Array.isArray(content)) {
70 return false
71 }
72 return content.some(
73 block =>
74 block.type === 'text' &&
75 block.text.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE),
76 )
77}
78
79/**
80 * Parse actual/limit token counts from a raw prompt-too-long API error

Callers 2

queryLoopFunction · 0.85
getPromptTooLongTokenGapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected