mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 02:27:43 +00:00
* fix(updater): send the gh token and cache the release picker's build list The dev build picker listed releases through api.github.com with no Authorization header, so it spent GitHub's 60/hour per-IP bucket that every unauthenticated caller on the same network shares, and it refetched on every settings mount and channel click. When that bucket ran dry the picker showed "No builds found" with a rate-limit line even though GitHub was healthy and the user's own token had its full quota. Attach the local `gh auth token` when there is one so the request draws from the user's 5000/hour bucket, fall back to unauthenticated on a rejected token or a spent token bucket, cache the list per channel for five minutes in the main process (the refresh button forces a reload), classify 403 by the rate-limit headers, and say when the limit resets. Fixes #21898 * fix(updater): don't trip breaker for secondary rate limits GitHub sends x-ratelimit-remaining: 0 on both primary and secondary limits. Secondary limits carry Retry-After and shouldn't block all core gh commands — only the primary limit should trip the shared breaker. * Scope gh rate limits to execution environment * Add build list cache hint to release channel settings Inform users that build lists are cached for 5 minutes and they can refresh to check for new builds immediately. This makes the cache behavior visible and explains why a manual refresh is necessary to bypass the cache.
50 lines
2.2 KiB
TypeScript
50 lines
2.2 KiB
TypeScript
/**
|
|
* Centralized git/gh/command runner with transparent WSL support.
|
|
*
|
|
* Why: when a repo lives on a WSL filesystem, native Windows binaries (git.exe,
|
|
* gh.exe, rg.exe) are absent or slow, so this routes execution through
|
|
* `wsl.exe -d <distro>` with translated Linux paths.
|
|
*
|
|
* The implementation lives in ./command-runner/*; this module stays the entry
|
|
* point its ~100 call sites (and their vi.mock factories) import from.
|
|
*/
|
|
// Re-exported for existing importers; lightweight consumers should import from './exec-error' to avoid this heavy module.
|
|
export { extractExecError, parseRetryAfterMs } from './exec-error'
|
|
|
|
export { setDefaultWslDistroOverride } from './command-runner/wsl-command-resolution'
|
|
export {
|
|
awaitWindowsHostGitEnvironmentReady,
|
|
configureWindowsHostGitEnvironmentReadiness
|
|
} from './command-runner/windows-host-git-environment'
|
|
export { DEFAULT_GIT_MAX_BUFFER } from './command-runner/git-exec-options'
|
|
export { GitCommandTimeoutError } from './command-runner/git-command-timeout'
|
|
export {
|
|
appendGitConfigEnv,
|
|
gitOptionalLocksDisabledEnv,
|
|
nonInteractiveGitEnv,
|
|
promptGuardGitEnv,
|
|
promptGuardShellEnv,
|
|
untranslatedGitOutputEnv
|
|
} from './command-runner/git-process-env'
|
|
export {
|
|
gitExecFileAsync,
|
|
gitExecFileAsyncBuffer,
|
|
gitExecFileSync
|
|
} from './command-runner/git-exec-file'
|
|
export { commandExecFileAsync } from './command-runner/command-exec-file'
|
|
export { gitStreamStdout, type GitStreamResult } from './command-runner/git-stream-stdout'
|
|
export {
|
|
gitSpawn,
|
|
gitSpawnAfterWindowsEnvironmentReady,
|
|
withGitAdmission
|
|
} from './command-runner/git-spawn'
|
|
export { isTransientGhError } from './command-runner/gh-retry-policy'
|
|
export { applyGhHostToArgs } from './command-runner/gh-host-args'
|
|
export { ghExecFileAsync, ghExecFileWithScopeAsync } from './command-runner/gh-exec-file'
|
|
export { glabExecFileAsync, redirectPortedHostnameToEnv } from './command-runner/glab-exec-file'
|
|
export { wslAwareSpawn } from './command-runner/wsl-aware-spawn'
|
|
export { translateWslOutputPaths } from './command-runner/wsl-path-translation'
|
|
|
|
/** Convenience re-export of wsl.ts path helpers so consumers don't import it directly. */
|
|
export { parseWslPath, toLinuxPath, toWindowsWslPath, isWslPath } from '../wsl'
|