earendil-works/pi · error
Provider stopped with: ${output.rawStopReason}
Error message
Provider stopped with: ${output.rawStopReason} What it means
Error "Provider stopped with: ${output.rawStopReason}" thrown in earendil-works/pi.
Source
Thrown at packages/ai/src/api/google-generative-ai.ts:275
contentIndex: blockIndex(),
content: currentBlock.thinking,
partial: output,
});
}
}
if (options?.signal?.aborted) {
throw new Error("Request was aborted");
}
if (output.stopReason === "pending") {
throw new Error("Google stream ended without a finish reason");
}
if (output.stopReason === "aborted" || output.stopReason === "error") {
const errorMessage = output.rawStopReason
? `Provider stopped with: ${output.rawStopReason}`
: "An unknown error occurred";
throw new Error(errorMessage);
}
stream.push({ type: "done", reason: output.stopReason, message: output });
stream.end();
} catch (error) {
// Remove internal index property used during streaming
for (const block of output.content) {
if ("index" in block) {
delete (block as { index?: number }).index;
}
}
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
output.errorMessage = formatProviderError(normalizeProviderError(error));
stream.push({ type: "error", reason: output.stopReason, error: output });
stream.end();
}
})();
View on GitHub (pinned to 4af9d21d3b)
Solutions
- Handle the raw stop reason in the message (for example SAFETY or MAX_TOKENS); adjust the prompt or limits.
When it happens
Trigger: Thrown at packages/ai/src/api/google-generative-ai.ts:275 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/00b949135ba7ebc7.
Report an issue: GitHub.