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:
parent
db3883d2e7
commit
af1b08fdf4
1 changed files with 3 additions and 1 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue