cline/cline · error · ContextWindowOverflowError
CONTEXT_WINDOW_OVERFLOW_NO_RECOVERY_MESSAGE
Error message
CONTEXT_WINDOW_OVERFLOW_NO_RECOVERY_MESSAGE
What it means
Error "CONTEXT_WINDOW_OVERFLOW_NO_RECOVERY_MESSAGE" thrown in cline/cline.
Source
Thrown at sdk/packages/agents/src/agent-runtime.ts:971
/**
* Run a model turn, recovering once per run from a provider-rejected
* context-window overflow: force a compaction through `prepareTurn` and
* retry the request. Terminal (unrecoverable) overflow states throw with
* an actionable message instead of the raw provider error.
*/
private async generateAssistantMessageWithOverflowRecovery(): Promise<{
message: AgentMessage;
finishReason: AgentModelFinishReason;
}> {
const first = await this.generateAssistantMessage();
if (!this.isRecoverableOverflowTurn(first)) {
return first;
}
this.overflowRecoveryAttempted = true;
const providerError = this.state.lastError;
if (!this.config.prepareTurn) {
throw new ContextWindowOverflowError(
CONTEXT_WINDOW_OVERFLOW_NO_RECOVERY_MESSAGE,
providerError,
);
}
await this.emit({
type: "status-notice",
snapshot: this.snapshot(),
message: "context window exceeded — compacting and retrying",
metadata: {
kind: "context_overflow_recovery",
reason: "context_overflow_recovery",
phase: "started",
iteration: this.state.iteration,
providerError,
},
});
const retry = await this.generateAssistantMessage({
overflowRecovery: true,View on GitHub (pinned to 491b30b806)
When it happens
Trigger: Thrown at sdk/packages/agents/src/agent-runtime.ts:971 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cline/cline@491b30b806 (2026-08-25).
Data as JSON: /api/errors/37707e2223efe93c.
Report an issue: GitHub.