jackwener/OpenCLI · error · CommandExecutionError

OpenReview API HTTP ${resp.status} for ${label}${body ? ` ($

Error message

OpenReview API HTTP ${resp.status} for ${label}${body ? ` (${body})` : ''}

What it means

openreviewFetch throws CommandExecutionError when the OpenReview API responds with a non-2xx status other than 404 (404 returns null to mean 'not found'). The message carries the HTTP status plus up to 200 chars of the response body. It indicates server-side rejection such as rate limiting or an API outage.

Source

Thrown at clis/openreview/utils.js:88

}

/** Wrap fetch + json with typed errors so failures never look like empty results. */
export async function openreviewFetch(path, label) {
    const url = `${OPENREVIEW_API}${path}`;
    let resp;
    try {
        resp = await fetch(url);
    }
    catch (e) {
        throw new CommandExecutionError(`Network failure fetching ${label}: ${e?.message ?? e}`, 'Check your network connection and try again.');
    }
    if (resp.status === 404) {
        return null;
    }
    if (!resp.ok) {
        let body = '';
        try { body = (await resp.text()).slice(0, 200); } catch {}
        throw new CommandExecutionError(`OpenReview API HTTP ${resp.status} for ${label}${body ? ` (${body})` : ''}`, 'The OpenReview API may be down or rate-limiting.');
    }
    let json;
    try {
        json = await resp.json();
    }
    catch (e) {
        throw new CommandExecutionError(`Malformed JSON from OpenReview for ${label}: ${e?.message ?? e}`, 'Try again or report this as an OpenReview API bug.');
    }
    const envelopeErrors = Array.isArray(json?.errors) ? json.errors.filter(Boolean) : [];
    const envelopeError = typeof json?.error === 'string' ? json.error.trim() : '';
    if (envelopeErrors.length || envelopeError) {
        const detail = envelopeError || envelopeErrors.map((entry) => {
            if (typeof entry === 'string') return entry;
            if (entry?.message) return String(entry.message);
            return JSON.stringify(entry);
        }).join('; ');
        throw new CommandExecutionError(`OpenReview API error for ${label}: ${detail}`, 'The OpenReview API returned an application-level error.');
    }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Wait and retry with backoff, especially for HTTP 429.
  2. Reduce request rate or batch lookups; cache forum/profile results.
  3. Check OpenReview status pages for ongoing incidents if 5xx persists.

Example fix

// before
const json = await openreviewFetch(path, label);
// after
try { var json = await openreviewFetch(path, label); }
catch (e) { if (/HTTP 429/.test(e.message)) { await sleep(5000); return openreviewFetch(path, label); } throw e; }
Defensive patterns

Strategy: retry

Try / catch

try { const json = await openreviewFetch(path, label); }
catch (e) {
  const m = /HTTP (\d+)/.exec(e.message);
  if (m && (m[1] === '429' || m[1].startsWith('5'))) { await sleep(5000); return openreviewFetch(path, label); }
  throw e;
}

Prevention

When it happens

Trigger: The API returns 429 (rate limit), 5xx (server error), 401/403, or 400 for the request labeled '${label}'.

Common situations: Hammering the API in a loop exceeding rate limits; OpenReview API instability during conference review deadlines; an invalid id occasionally surfacing as 400 from the API.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/071d603ba0dfc0d4. Report an issue: GitHub.