forked from farhoodlabs/paperclip
fix(pi-local): parse models from stderr
Pi outputs the model list to stderr instead of stdout. This fix checks stderr first and falls back to stdout for compatibility with older versions. Fixes model discovery returning empty arrays and environment tests failing with 'Pi returned no models' error.
This commit is contained in:
@@ -131,7 +131,9 @@ export async function discoverPiModels(input: {
|
||||
throw new Error(detail ? `\`pi --list-models\` failed: ${detail}` : "`pi --list-models` failed.");
|
||||
}
|
||||
|
||||
return sortModels(dedupeModels(parseModelsOutput(result.stdout)));
|
||||
// Pi outputs model list to stderr, but fall back to stdout for older versions
|
||||
const output = result.stderr || result.stdout;
|
||||
return sortModels(dedupeModels(parseModelsOutput(output)));
|
||||
}
|
||||
|
||||
function normalizeEnv(input: unknown): Record<string, string> {
|
||||
|
||||
Reference in New Issue
Block a user