paperclipai/paperclip · error
`pi --list-models` failed
Error message
`pi --list-models` failed: ${detail} What it means
Error "`pi --list-models` failed: ${detail}" thrown in paperclipai/paperclip.
Solutions
- Run `pi --list-models` manually to see the failure and fix it (auth, install).
When it happens
Trigger: Thrown at packages/adapters/pi-local/src/server/models.ts:131 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18).
Data as JSON: /api/errors/8985dc7f39e5e6a4.
Report an issue: GitHub.
Appendix: source
Thrown at packages/adapters/pi-local/src/server/models.ts:131
const result = await runChildProcess(
`pi-models-${Date.now()}-${Math.random().toString(16).slice(2)}`,
command,
["--list-models"],
{
cwd,
env: runtimeEnv,
timeoutSec: 20,
graceSec: 3,
onLog: async () => {},
},
);
if (result.timedOut) {
throw new Error("`pi --list-models` timed out.");
}
if ((result.exitCode ?? 1) !== 0) {
const detail = firstNonEmptyLine(result.stderr) || firstNonEmptyLine(result.stdout);
throw new Error(detail ? `\`pi --list-models\` failed: ${detail}` : "`pi --list-models` failed.");
}
// 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> {
const envInput = typeof input === "object" && input !== null && !Array.isArray(input)
? (input as Record<string, unknown>)
: {};
const env: Record<string, string> = {};
for (const [key, value] of Object.entries(envInput)) {
if (typeof value === "string") env[key] = value;
}
return env;
}
View on GitHub (pinned to 120ae5428f)