can1357/oh-my-pi · error · AIError.ConfigurationError
OMP_AUTH_BROKER_ACCOUNT_POOL_FILE entry for ${provider} must
Error message
OMP_AUTH_BROKER_ACCOUNT_POOL_FILE entry for ${provider} must be an array of identity keys What it means
Each provider's value in the pool file must be an array of identity-key strings. If the value for a provider is an object, string, number, or null instead of an array, the loader throws this ConfigurationError naming the offending provider. The array shape is required because each provider maps to a set of allowed identity keys.
Source
Thrown at packages/ai/src/auth-broker/discover.ts:146
});
}
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
throw new AIError.ConfigurationError("OMP_AUTH_BROKER_ACCOUNT_POOL_FILE must contain a JSON object");
}
const accountPool = new Map<string, ReadonlySet<string>>();
for (const [provider, value] of Object.entries(parsed)) {
const normalizedProvider = provider.trim();
if (normalizedProvider.length === 0) {
throw new AIError.ConfigurationError("OMP_AUTH_BROKER_ACCOUNT_POOL_FILE contains an empty provider id");
}
if (provider !== normalizedProvider) {
throw new AIError.ConfigurationError(
"OMP_AUTH_BROKER_ACCOUNT_POOL_FILE contains a provider id with surrounding whitespace",
);
}
if (!Array.isArray(value)) {
throw new AIError.ConfigurationError(
`OMP_AUTH_BROKER_ACCOUNT_POOL_FILE entry for ${provider} must be an array of identity keys`,
);
}
const identities = new Set<string>();
for (const identity of value) {
if (typeof identity !== "string" || identity.length === 0) {
throw new AIError.ConfigurationError(
`OMP_AUTH_BROKER_ACCOUNT_POOL_FILE entry for ${provider} contains an invalid identity key`,
);
}
if (identity !== identity.trim()) {
throw new AIError.ConfigurationError(
`OMP_AUTH_BROKER_ACCOUNT_POOL_FILE entry for ${provider} contains an identity key with surrounding whitespace`,
);
}
identities.add(identity);
}
accountPool.set(provider, identities);View on GitHub (pinned to 9690622007)
Solutions
- Change the provider's value to an array: wrap the identity key(s) in [ ].
- If migrating from a scalar-per-provider format, map each value to a single-element array during conversion.
- Validate per-entry: `jq 'to_entries | map(select(.value | type != "array"))' pool.json` should return [].
- Update any script that writes the pool file to serialize arrays for every provider.
Example fix
// before (account-pool.json)
{
"openai": "acc1"
}
// after
{
"openai": ["acc1"]
} Defensive patterns
Strategy: validation
Validate before calling
function validateEntryArrays(pool: Record<string, unknown>): void {
for (const [provider, value] of Object.entries(pool)) {
if (!Array.isArray(value)) {
throw new Error(`entry for ${provider} must be an array of identity keys`);
}
}
} Type guard
function isIdentityKeyArray(v: unknown): v is string[] {
return Array.isArray(v) && v.every((x): x is string => typeof x === "string");
} Try / catch
try {
const pool = await loadAuthBrokerAccountPool();
} catch (err) {
if (err instanceof AIError.ConfigurationError && err.message.includes("must be an array of identity keys")) {
logger.error("pool file provider entry is not an array; wrap identity keys in [ ]");
} else throw err;
} Prevention
- Always serialize provider values as arrays, even for a single identity key: ["acc1"].
- When migrating from older scalar formats, convert values with a mapping step.
- Validate in CI: `jq 'to_entries | map(select(.value | type != "array")) | length' pool.json` must be 0.
- Keep the writer script and the reader's schema in sync — version the pool file format if it changes.
When it happens
Trigger: OMP_AUTH_BROKER_ACCOUNT_POOL_FILE maps a provider to a non-array, e.g. { "openai": "acc1" } or { "openai": { "default": "acc1" } } instead of { "openai": ["acc1"] }.
Common situations: Older pool-file format using a single identity string per provider, migrated files that kept the scalar form, or hand-written configs where the brackets around the identity list were omitted.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- OMP_AUTH_BROKER_ACCOUNT_POOL_FILE must contain a JSON object
- OMP_AUTH_BROKER_ACCOUNT_POOL_FILE contains an empty provider
- Auth broker response failed schema validation
- Unable to read OMP_AUTH_BROKER_ACCOUNT_POOL_FILE at ${filePa
- OMP_AUTH_BROKER_ACCOUNT_POOL_FILE contains a provider id wit
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/ffbe5ec73674dbd3.
Report an issue: GitHub.