paperclipai/paperclip · error
decision predicate failed
Error message
${options.errorLabel} decision predicate failed: ${detail} What it means
Wrapper error for the Codex auth merge decision helper: decideCodexAuthMerge shells out to a Node decision script and maps known exit codes to decisions; when execFile('node') fails with something outside KNOWN_EXIT_CODES — e.g. node could not be spawned (ENOENT/EACCES reported as a string code) or the predicate crashed with an unexpected exit code — it surfaces a labeled failure so callers can distinguish 'predicate answered' from 'predicate never ran'. Generic guard: the input at fault is the node execution environment or the decision script itself, not the merge decision.
Solutions
- Inspect the decision predicate failure detail and fix the predicate or its inputs.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/adapters/codex-local/src/server/codex-auth-merge-decision.ts:66 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18).
Data as JSON: /api/errors/41312e0d28658d85.
Report an issue: GitHub.
Appendix: source
Thrown at packages/adapters/codex-local/src/server/codex-auth-merge-decision.ts:73
const args = options.seedIfDestAbsent
? [DECISION_SCRIPT_PATH, SEED_IF_DEST_ABSENT_FLAG, sourcePath, destinationPath]
: [DECISION_SCRIPT_PATH, sourcePath, destinationPath];
try {
await execFile("node", args);
} catch (error) {
const code = (error as { code?: unknown }).code;
if (typeof code === "number" && KNOWN_EXIT_CODES.has(code)) {
return code;
}
const detail =
typeof code === "string"
? `node could not be executed (${code})`
: typeof code === "number"
? `unexpected predicate exit code ${code}`
: error instanceof Error
? error.message
: String(error);
throw new Error(`${options.errorLabel} decision predicate failed: ${detail}`);
}
// `execFile` resolved, so the predicate exited 0. The predicate always exits
// 10, 20, or 22, so a clean exit 0 is unexpected; fail loud.
throw new Error(
`${options.errorLabel} decision predicate exited 0 (expected 10, 20, or 22)`,
);
}
View on GitHub (pinned to 3f1d897a7c)