From 44f61b1aee3d68d1bdff584470a6aaef088fee54 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Fri, 12 Jun 2026 20:48:18 -0700 Subject: [PATCH] Show host scope for provider API budgets Co-authored-by: Orca --- .../host-context-implementation-checklist.md | 1 + .../github/github-rate-limit-display.tsx | 13 +++++++ .../gitlab/gitlab-rate-limit-display.tsx | 13 +++++++ .../settings/provider-account-scope.test.ts | 13 ++++++- .../settings/provider-account-scope.ts | 28 +++++++++++++-- .../provider-rate-limit-scope-panels.test.tsx | 36 +++++++++++++++++++ 6 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 src/renderer/src/components/settings/provider-rate-limit-scope-panels.test.tsx diff --git a/notes/host-context-implementation-checklist.md b/notes/host-context-implementation-checklist.md index 389ef0d3257..a6762ec6aa5 100644 --- a/notes/host-context-implementation-checklist.md +++ b/notes/host-context-implementation-checklist.md @@ -221,6 +221,7 @@ Done means: reviewers and future agents can understand the vision, implementatio - [x] 2026-06-12: Threaded GitHub Tasks row-level mutations through `TaskSourceContext` for issue state, assignees, reviewer requests/removals, PR merge/auto-merge, and new issue creation/follow-up reads; verified with focused GitHub/TaskPage tests, focused oxlint, `pnpm run typecheck`, and `git diff --check`. - [x] 2026-06-12: Added provider account-scope diagnostics to GitHub/GitLab CLI integration cards so code-host credential checks show whether they belong to the local desktop client or selected remote server, matching the existing Linear/Jira ownership copy; verified with focused integration-card scope tests and oxlint. - [x] 2026-06-12: Extended task-detail navigation state to GitLab and fixed Linear replay so saved `TaskSourceContext` is restored through back/forward and direct detail reopens; GitLab detail history keys now include source scope so identical MRs from different hosts stay distinct. Verified with focused UI/history/static-boundary tests and oxlint. +- [x] 2026-06-12: Added host-scoped budget diagnostics to the GitHub and GitLab API Budget settings panels so rate-limit views explicitly say whether they are fetched from the local desktop CLI or selected remote-server CLI; verified with focused provider scope/panel render tests and oxlint. - [x] 2026-06-12: Updated PR #5071 with the current verified scope, evidence docs, validation commands, explicit out-of-scope cloud/onboarding items, and remaining provider/version-skew risk. - [x] 2026-06-12: Added load-time backfill for legacy automations and automation runs that predate `runContext`/`sourceContext`, deriving explicit project host and provider source contexts from the saved repo id/path; verified with focused persistence migration coverage, automation service/precheck tests, daemon/settings merge-repair tests, and full `pnpm run typecheck`. - [x] 2026-06-12: Repaired the merge-repair lint gate without disabling max-lines by extracting automation run-target/usage modules and settings subcomponents, fixed stale source-context hook dependencies, and tightened GitHub PR checks cache ownership so `noCache` bypasses cache/in-flight requests while head-specific checks are reused during refresh events; verified targeted oxlint, focused automation/settings/GitHub cache tests (10 files / 157 tests), `github-checks-cache.test.ts`, `git diff --check`, and full `pnpm run typecheck`. diff --git a/src/renderer/src/components/github/github-rate-limit-display.tsx b/src/renderer/src/components/github/github-rate-limit-display.tsx index e40fb04c62a..f05f7ac479e 100644 --- a/src/renderer/src/components/github/github-rate-limit-display.tsx +++ b/src/renderer/src/components/github/github-rate-limit-display.tsx @@ -5,6 +5,7 @@ import { installWindowVisibilityInterval } from '@/lib/window-visibility-interva import { useAppStore } from '@/store' import { callRuntimeRpc, getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client' import type { GetRateLimitResult, GitHubRateLimitSnapshot } from '../../../../shared/types' +import { getProviderRateLimitScope } from '@/components/settings/provider-account-scope' import { translate } from '@/i18n/i18n' const REFRESH_INTERVAL_MS = 60_000 @@ -169,6 +170,8 @@ function GitHubRateLimitRows({ export function GitHubRateLimitPanel({ className }: { className?: string }): React.JSX.Element { const { snapshot, hasError, isFetching, refresh } = useGitHubRateLimitSnapshot() + const settings = useAppStore((s) => s.settings) + const budgetScope = getProviderRateLimitScope(settings, 'GitHub') return (
@@ -187,6 +190,16 @@ export function GitHubRateLimitPanel({ className }: { className?: string }): Rea 'Orca uses REST, Search, and GraphQL through the GitHub CLI.' )}

+

+ + {translate( + 'auto.components.github.github.rate.limit.display.budget_scope', + 'Budget scope: {{value0}}', + { value0: budgetScope.label } + )} + {' '} + {budgetScope.description} +