mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +00:00
fix(cursor): tear down oversized daemon model responses
- destroy the response stream when /v1/models exceeds the body limit - prevent the oversized-response fallback test from hanging during server shutdown
This commit is contained in:
@@ -205,8 +205,10 @@ export async function fetchModelsFromDaemon(port: number): Promise<CursorModel[]
|
|||||||
data += chunk;
|
data += chunk;
|
||||||
if (data.length > MAX_BODY_SIZE) {
|
if (data.length > MAX_BODY_SIZE) {
|
||||||
debugLog('Cursor daemon /v1/models body exceeded 1MB; falling back to defaults');
|
debugLog('Cursor daemon /v1/models body exceeded 1MB; falling back to defaults');
|
||||||
|
res.destroy();
|
||||||
req.destroy();
|
req.destroy();
|
||||||
safeResolve(DEFAULT_CURSOR_MODELS);
|
safeResolve(DEFAULT_CURSOR_MODELS);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user