{"record":{"id":"3fde3613b4a6768e","repo":"eyaltoledano/claude-task-master","slug":"timeout","errorCode":"TIMEOUT","errorMessage":"${message}","messagePattern":"\\$\\{message\\}","errorType":"error_code","errorClass":"APICallError","httpStatus":null,"severity":"warning","filePath":"packages/ai-sdk-provider-grok-cli/src/errors.ts","lineNumber":107,"sourceCode":"\tmessage\n}: CreateAuthenticationErrorParams): LoadAPIKeyError {\n\treturn new LoadAPIKeyError({\n\t\tmessage:\n\t\t\tmessage ||\n\t\t\t'Authentication failed. Please ensure Grok CLI is properly configured with API key.'\n\t});\n}\n\n/**\n * Create a timeout error\n */\nexport function createTimeoutError({\n\tmessage,\n\tpromptExcerpt,\n\ttimeoutMs\n}: CreateTimeoutErrorParams): APICallError {\n\tconst metadata: GrokCliErrorMetadata & { timeoutMs: number } = {\n\t\tcode: 'TIMEOUT',\n\t\tpromptExcerpt,\n\t\ttimeoutMs\n\t};\n\n\treturn new APICallError({\n\t\tmessage,\n\t\tisRetryable: true,\n\t\turl: 'grok-cli://command',\n\t\trequestBodyValues: promptExcerpt ? { prompt: promptExcerpt } : undefined,\n\t\tdata: metadata\n\t});\n}\n\n/**\n * Create a CLI installation error\n */\nexport function createInstallationError({\n\tmessage","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/ai-sdk-provider-grok-cli/src/errors.ts#L89-L125","documentation":"createTimeoutError builds an AI SDK APICallError with metadata.code 'TIMEOUT' and the configured timeoutMs, marked isRetryable: true. The Grok CLI provider throws it when the spawned grok CLI process exceeds its time budget during executeGrokCli.","triggerScenarios":"executeGrokCli runs the grok CLI child process with a timeout; when the process doesn't finish within timeoutMs, createTimeoutError is invoked with the elapsed limit and a prompt excerpt.","commonSituations":"Very large or complex prompts making the CLI slow; slow network to Grok API from the CLI; too-low timeout setting; CLI hanging waiting for input or authentication.","solutions":["Increase the provider's timeoutMs option to accommodate long-running prompts","Retry the call — the error is flagged isRetryable: true","Verify the grok CLI works standalone (network/API key) and isn't hanging","Reduce prompt size/complexity to shorten execution time"],"exampleFix":"// before\ncreateGrokCli({ timeoutMs: 10000 }); // times out on big prompts\n// after\ncreateGrokCli({ timeoutMs: 120000 });","handlingStrategy":"retry","validationCode":"function isReasonableTimeout(opts: { timeoutMs?: number }) {\n  if (opts.timeoutMs !== undefined && opts.timeoutMs < 30000) {\n    console.warn('timeoutMs below 30s is likely too small for grok CLI calls');\n  }\n}","typeGuard":"function isTimeoutError(e: unknown): e is APICallError {\n  return e instanceof APICallError && (e.data as any)?.code === 'TIMEOUT';\n}","tryCatchPattern":"try {\n  return await model.doGenerate(params);\n} catch (e) {\n  if (isTimeoutError(e)) {\n    // e.isRetryable === true; retry with backoff, optionally raise timeoutMs\n    return withBackoff(() => model.doGenerate(params));\n  }\n  throw e;\n}","preventionTips":["Set timeoutMs generously (60s+) for long or complex prompts","Retry on TIMEOUT — the error is explicitly marked retryable","Verify the grok CLI runs successfully standalone before blaming the provider","Reduce prompt size to keep CLI execution time bounded"],"tags":["timeout","ai-sdk","cli","retryable"],"backgroundTag":"request-timeout","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}