mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 22:21:20 +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;
|
||||
if (data.length > MAX_BODY_SIZE) {
|
||||
debugLog('Cursor daemon /v1/models body exceeded 1MB; falling back to defaults');
|
||||
res.destroy();
|
||||
req.destroy();
|
||||
safeResolve(DEFAULT_CURSOR_MODELS);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user