Pane icon indicating copy to clipboard operation
Pane copied to clipboard

runpane doctor calls GitHub's release API without signing in on every run; hitting the rate limit makes it report ok: false

Open parsakhaz opened this issue 1 month ago • 2 comments

runpane doctor looks up the latest release on GitHub every time it runs, without signing in. GitHub allows 60 unauthenticated requests per hour per IP. Agents run doctor at the start of most tasks, so a busy machine uses up that limit quickly.

When the lookup fails, doctor reports "ok": false even if the daemon is reachable. An agent that checks ok then concludes Pane is down.

Evidence

  • packages/runpane/src/doctor.ts: buildDoctorReport always calls collectReleaseCheck, which calls resolveRelease → fetchRelease in packages/runpane/src/releases.ts.
  • fetchRelease calls https://api.github.com/repos/greenfield-inc/Pane/releases/latest and sends no Authorization header.
  • The same file sets ok: release.ok && daemon.reachable && remoteSetup.ready.
  • The response headers show x-ratelimit-limit: 60.
  • Observed on 2026-10-26: a CLI benchmark that called doctor repeatedly (about 60 calls) used up the hourly quota on this machine. Until the quota reset, doctor reported a release-check failure while the daemon was healthy.

Repro

  1. Run for i in $(seq 70); do runpane doctor --json >/dev/null; done
  2. Run runpane doctor --json. It shows release.ok: false with a 403 error and ok: false, while daemon.reachable is true.

Possible fix shapes

  • Leave the release lookup out of the default doctor run, or cache its result for a while (for example, an hour).
  • Keep a failed release check from making the top-level ok false. It is a notice about updates, not a health problem.
  • Optionally, send GH_TOKEN when one is set.

🤖 Generated with Claude Code

parsakhaz avatar Oct 27 '26 15:10 parsakhaz

Hey, I'd like to take this one. Still the same on main: buildDoctorReport calls collectReleaseCheck on every run, fetchRelease in releases.ts hits releases/latest with no auth, and doctor.ts:461 ANDs release.ok into the top-level ok, so one 403 makes a healthy daemon look down. Plan: send GH_TOKEN/GITHUB_TOKEN as a bearer token when set (never printed), cache the last good lookup under <pane-dir>/runpane/ for an hour with a fallback to a recent cached answer when a refresh fails, and turn a failed lookup into a warning on release with a next instead of flipping ok. Same cache file and byte-identical --json in the Python CLI, with tests that stub the HTTP layer so nothing hits GitHub.

ilijachrchev avatar Nov 16 '26 22:11 ilijachrchev

PR's up: #1463. Doctor caches the lookup for an hour, uses GH_TOKEN/GITHUB_TOKEN when set, and a failed lookup is now a warning on release instead of ok: false.

ilijachrchev avatar Nov 16 '26 22:11 ilijachrchev