eyaltoledano/claude-task-master · warning · APICallError
TIMEOUT
TIMEOUT
Error message
${message} What it means
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.
Source
Thrown at packages/ai-sdk-provider-grok-cli/src/errors.ts:107
message
}: CreateAuthenticationErrorParams): LoadAPIKeyError {
return new LoadAPIKeyError({
message:
message ||
'Authentication failed. Please ensure Grok CLI is properly configured with API key.'
});
}
/**
* Create a timeout error
*/
export function createTimeoutError({
message,
promptExcerpt,
timeoutMs
}: CreateTimeoutErrorParams): APICallError {
const metadata: GrokCliErrorMetadata & { timeoutMs: number } = {
code: 'TIMEOUT',
promptExcerpt,
timeoutMs
};
return new APICallError({
message,
isRetryable: true,
url: 'grok-cli://command',
requestBodyValues: promptExcerpt ? { prompt: promptExcerpt } : undefined,
data: metadata
});
}
/**
* Create a CLI installation error
*/
export function createInstallationError({
messageView on GitHub (pinned to c0c98d367c)
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
Example fix
// before
createGrokCli({ timeoutMs: 10000 }); // times out on big prompts
// after
createGrokCli({ timeoutMs: 120000 }); Defensive patterns
Strategy: retry
Validate before calling
function isReasonableTimeout(opts: { timeoutMs?: number }) {
if (opts.timeoutMs !== undefined && opts.timeoutMs < 30000) {
console.warn('timeoutMs below 30s is likely too small for grok CLI calls');
}
} Type guard
function isTimeoutError(e: unknown): e is APICallError {
return e instanceof APICallError && (e.data as any)?.code === 'TIMEOUT';
} Try / catch
try {
return await model.doGenerate(params);
} catch (e) {
if (isTimeoutError(e)) {
// e.isRetryable === true; retry with backoff, optionally raise timeoutMs
return withBackoff(() => model.doGenerate(params));
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- SAMPLING_ERROR
- MFA_VERIFICATION_FAILED
- MFA_VERIFICATION_FAILED
- MCP provider requires session object
- The MCP model function cannot be called with the new keyword
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/3fde3613b4a6768e.
Report an issue: GitHub.