microsoft/vscode · error · CompletionsFetchError
stop_length
stop_length
Error message
Length limit
What it means
Error "Length limit" thrown in microsoft/vscode.
Source
Thrown at extensions/copilot/src/extension/prompts/node/codeMapper/codeMapper.ts:777
this.telemetryService.sendMSFTTelemetryEvent('speculation.response.loop', {
speculationRequestId: result.requestId,
languageId: isNewDocument(request) ? getLanguageForResource(uri).languageId : request.existingDocument.languageId,
model,
hasLoop: String(hasLoop)
}, {
documentLength,
rewrittenLength: responseLength
});
}
private ensureFinishReasonStopOrThrow(requestId: string, finishReason: Completion.FinishReason | undefined) {
switch (finishReason) {
case undefined:
break;
case Completion.FinishReason.ContentFilter:
throw new CompletionsFetchError('stop_content_filter', requestId, 'Content filter');
case Completion.FinishReason.Length:
throw new CompletionsFetchError('stop_length', requestId, 'Length limit');
case Completion.FinishReason.Stop:
break; // No error for 'Stop' finish reason
default:
assertNever(finishReason);
}
}
//#endregion
}
function readLineByLine(source: AsyncIterable<string>, token: CancellationToken): AsyncIterable<LineOfText> {
return new AsyncIterableObject<LineOfText>(async (emitter) => {
const reader = new PartialAsyncTextReader(source[Symbol.asyncIterator]());
let previousLineWasEmpty = false; // avoid emitting a trailing empty line all the time
while (!reader.endOfStream) {
// Skip everything until we hit a fence
if (token.isCancellationRequested) {
break;View on GitHub (pinned to a94b963a32)
When it happens
Trigger: Thrown at extensions/copilot/src/extension/prompts/node/codeMapper/codeMapper.ts:777 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12).
Data as JSON: /api/errors/c2a08a2af6d2bb7c.
Report an issue: GitHub.