can1357/oh-my-pi · warning
Limit must be a positive number.
Error message
Limit must be a positive number.
What it means
In the provider editor for providers.maxInFlightRequests, each per-provider limit must be a finite number greater than 0. Empty input deletes the provider's entry (inheriting the default); anything else that is NaN, Infinity, or <= 0 throws this error and the edit is rejected.
Source
Thrown at packages/coding-agent/src/modes/components/settings-selector.ts:484
#showProviderEditor(provider: string): void {
const limits = normalizeProviderMaxInFlightRequests(settings.get("providers.maxInFlightRequests"));
this.clear();
this.#selectList = undefined;
this.addChild(
new TextInputSubmenu(
`Max In-Flight Requests: ${provider}`,
"Enter a positive number. Decimals round down. Clear the field to make this provider unlimited.",
limits[provider]?.toString() ?? "",
false,
value => {
const next = { ...limits };
const trimmed = value.trim();
if (trimmed === "") {
delete next[provider];
} else {
const limit = Number(trimmed);
if (!Number.isFinite(limit) || limit <= 0) throw new Error("Limit must be a positive number.");
next[provider] = Math.max(1, Math.floor(limit));
}
const normalized = validateProviderMaxInFlightRequests(next);
settings.set("providers.maxInFlightRequests", normalized);
this.onChange(normalized);
this.#showProviderList();
this.requestRender?.();
},
() => {
this.#showProviderList();
this.requestRender?.();
},
),
);
}
handleInput(data: string): void {
if (this.#selectList) {View on GitHub (pinned to 9690622007)
Solutions
- Enter a positive number (decimals are floored, minimum enforced value is 1)
- Clear the field entirely to remove the per-provider override and use the default
- Use '1' or higher for throttling instead of 0
- Edit the raw JSON record value via the record editor with valid JSON like {"anthropic": 4}
Example fix
// before limit input: "0" -> throws // after limit input: "" (remove override) or "4" (valid limit)
Defensive patterns
Strategy: validation
Validate before calling
const limit = Number(value.trim());
if (value.trim() !== "" && (!Number.isFinite(limit) || limit <= 0)) {
throw new Error("Limit must be a positive number");
} Type guard
function isValidLimit(v: string): boolean {
const t = v.trim();
if (t === "") return true;
const n = Number(t);
return Number.isFinite(n) && n > 0;
} Try / catch
try {
editor.setProviderLimit(value);
} catch (err) {
if (err instanceof Error && err.message === "Limit must be a positive number.") {
// re-prompt for a positive number or clear to remove the override
} else throw err;
} Prevention
- Only enter plain positive numbers (no units, no 0)
- Clear the field to remove an override rather than entering 0
- Use '.' as the decimal separator
- Validate numeric inputs before submitting
When it happens
Trigger: Typing a non-numeric or non-positive value (e.g. 'abc', '-3', '0', '1e999') into the per-provider in-flight-request limit field in #showProviderEditor.
Common situations: Typo when editing the limit; attempting to disable a provider by entering 0 (instead of clearing the field); paste with units ('10 req'); locale decimal comma parsed as NaN.
Related errors
- Provider request limits must be positive numbers: ${invalidP
- Settings config is invalid: ${filePath}${result.backupPath ?
- Invalid record JSON for ${path}
- Unsupported language '{value}'. Supported: {}
- Unable to infer language from file extension: {}. Specify `l
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/288b825f4c9708a8.
Report an issue: GitHub.