earendil-works/pi · error
Invalid trust store ${path}: expected an object
Error message
Invalid trust store ${path}: expected an object What it means
Error "Invalid trust store ${path}: expected an object" thrown in earendil-works/pi.
Source
Thrown at packages/coding-agent/src/core/trust-manager.ts:112
}
return trustOptions;
}
function readTrustFile(path: string): TrustFile {
if (!existsSync(path)) {
return {};
}
let parsed: unknown;
try {
parsed = JSON.parse(stripBom(readFileSync(path, "utf-8")));
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to read trust store ${path}: ${message}`);
}
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
throw new Error(`Invalid trust store ${path}: expected an object`);
}
const data: TrustFile = {};
for (const [key, value] of Object.entries(parsed)) {
if (value !== true && value !== false && value !== null) {
throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);
}
data[key] = value;
}
return data;
}
function writeTrustFile(path: string, data: TrustFile): void {
const sorted: TrustFile = {};
for (const key of Object.keys(data).sort()) {
const value = data[key];
if (value === true || value === false || value === null) {
sorted[key] = value;View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/coding-agent/src/core/trust-manager.ts:112 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/178eb43364812025.
Report an issue: GitHub.