can1357/oh-my-pi · error
Provider request limits must be positive numbers: ${invalidP
Error message
Provider request limits must be positive numbers: ${invalidProviders.join(", ")} What it means
Thrown by validateProviderMaxInFlightRequests when one or more entries in the provider request-limits setting are not positive finite numbers. Valid limits are floored to an integer with a minimum of 1; entries that cannot be so normalized (non-numeric, NaN, <= 0, non-finite) are collected and reported together with the provider names.
Source
Thrown at packages/coding-agent/src/config/settings.ts:263
if (typeof rawLimit !== "number" || !Number.isFinite(rawLimit) || rawLimit <= 0) continue;
normalized[provider] = Math.max(1, Math.floor(rawLimit));
}
return normalized;
}
export function validateProviderMaxInFlightRequests(value: unknown): Record<string, number> {
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
const invalidProviders: string[] = [];
const normalized: Record<string, number> = {};
for (const [provider, rawLimit] of Object.entries(value)) {
if (typeof rawLimit !== "number" || !Number.isFinite(rawLimit) || rawLimit <= 0) {
invalidProviders.push(provider);
continue;
}
normalized[provider] = Math.max(1, Math.floor(rawLimit));
}
if (invalidProviders.length > 0) {
throw new Error(`Provider request limits must be positive numbers: ${invalidProviders.join(", ")}`);
}
return normalized;
}
const PATH_SCOPED_ARRAY_SETTINGS = new Set<SettingPath>(["enabledModels", "disabledProviders"]);
type PathScopedStringArrayEntry = {
path?: unknown;
paths?: unknown;
pathPrefix?: unknown;
pathPrefixes?: unknown;
values?: unknown;
items?: unknown;
models?: unknown;
providers?: unknown;
};
function expandTilde(p: string): string {
return p === "~" ? os.homedir() : p.startsWith("~/") ? path.join(os.homedir(), p.slice(2)) : p;View on GitHub (pinned to 9690622007)
Solutions
- Change the listed providers' limits to positive integers (1 or more)
- Remove entries for providers you do not want limited
- Quote-free numeric values in YAML: verify no stray quotes make them strings like "0"
Example fix
// before (settings.yaml) providerMaxInFlightRequests: openai: 0 anthropic: "three" // after providerMaxInFlightRequests: openai: 4 anthropic: 2
Defensive patterns
Strategy: validation
Validate before calling
function validLimits(map) {
return Object.entries(map ?? {}).every(([, v]) => Number.isFinite(v) && v > 0);
} Type guard
function isPositiveFinite(v) { return typeof v === 'number' && Number.isFinite(v) && v > 0; } Try / catch
try { settings.set('providerMaxInFlightRequests', map); } catch (e) { if (String(e).startsWith('Provider request limits must be positive')) { logger.error('Fix limits map', { map }); } else throw e; } Prevention
- Write limits as bare positive integers in YAML (no quotes)
- Remember the minimum is 1 — there is no 0 = unlimited
- Validate settings files with a linter before saving
When it happens
Trigger: Setting the provider request limits setting (via parseAndSetValue / setting hooks / normalized merge paths) with values like "abc", 0, -5, or null for a named provider.
Common situations: Typo in a limits map in settings.yaml (string instead of number), copy-pasted config with 0 intended as 'no limit', locale-formatted numbers.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Failed to load tree-sitter language: {err}
- Destination option ${key} must be a string
- Destination option ${key} must be a finite number
- Destination option ${key} must be a boolean
- ${destination} returned an invalid upload URL
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/8a44ff80f6312456.
Report an issue: GitHub.