MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / isPromptTooLongMessage

Function isPromptTooLongMessage

source code/services/api/errors.ts:66–79  ·  view source on GitHub ↗
(msg: AssistantMessage)

Source from the content-addressed store, hash-verified

64export const PROMPT_TOO_LONG_ERROR_MESSAGE = 'Prompt is too long'
65
66export function isPromptTooLongMessage(msg: AssistantMessage): boolean {
67 if (!msg.isApiErrorMessage) {
68 return false
69 }
70 const content = msg.message.content
71 if (!Array.isArray(content)) {
72 return false
73 }
74 return content.some(
75 block =>
76 block.type === 'text' &&
77 block.text.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE),
78 )
79}
80
81/**
82 * 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