Skip to content

Avoid refreshing GitHub accounts while editing project names - #26228

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-repository-account-refresh
Oct 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-repository-account-refresh

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Editing a project's display name restarted its GitHub account lookup after every saved character. Five name edits caused six auth-status checks, including the initial lookup, and kept the account selector busy. The account list now stays loaded while the name changes.

What Changed

The lookup callback depends on the repository ID, path, and execution target. Its automatic refresh also tracks execution-owner IDs, canonical remote identity, and the bound account's host/user. The routing helper accepts the ID/path it actually sends. Manual refresh and stale-reply guards retain their existing behavior.

Why

Repository updates create a new object even when the account lookup's inputs stay identical. Tracking those inputs removes redundant requests at their source without introducing a cache, debounce, or expiry policy. Relevant account and host changes still reload the list.

Linked Issue

N/A — internal performance audit; no existing issue for this finding.

Visual Proof

Matched screenshots after five committed name edits: before, another account request is pending and the selector is disabled; after, the original inventory remains usable. Captured through Playwright CDP in a hidden, fresh-built Orca renderer on macOS. The actual repository pane, name input, update action, Zustand store, and account controls render with generated repository data and controlled account IPC/RPC replies; unrelated sibling sections are replaced.

Before:

Before: account lookup restarts while editing the name

After:

After: account selector stays loaded

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Eleven regression tests cover name edits, repository/path/owner/account/remote-identity changes, runtime routing, forced refresh, stale replies, and current binding callbacks. The name-edit test fails against the original source: expected one lookup, received six.

  • Actual RepositoryPane + input + store/update action + production backend inventory/diagnostics, with a controlled external CLI runner: five committed name edits reduce gh auth status dispatches from 6 to 1. The capability probe remains one. This measures dispatches, not physical subprocess or network latency.

  • Eleven paired scope controls preserve request routing, forced refresh, loading generations, and binding behavior. A project-only WSL preference change retains the original automatic-refresh behavior; manual refresh reads the latest controlled backend preference.

  • Hidden Electron check repeats the five real input edits with actual Radix controls: 6 requests / disabled selector / spinner → 1 request / enabled selector / no spinner. The account menu opens, explicit refresh remains forced, and execution-owner changes route to the remote RPC target.

  • 1,508 tests passed across 218 files in the settings, runtime-owner, and account suites. Renderer typecheck, four-file changed-code quality gate, formatting, and a fresh Electron build passed.

  • Combined branch with all 28 audit changes: 3,799 passing tests across 472 files, plus two skipped tests in one skipped file; full pnpm tc passed and the 93-file changed-code quality gate reports no new findings.

  • Local validation ran on macOS. Remote routing and WSL controls use controlled adapters; actual SSH/WSL hosts and Linux/Windows UI were not exercised. Hosted CI passed: all five Node24 test shards, static analysis/typecheck, relay integration, and macOS/Windows packaging.

Review

Independent review traced the registered-repository IPC/RPC handlers and execution-host resolution. The backend still resolves fresh stored repository/project/runtime state. Existing account validation, manual capability refresh, mixed-version behavior, and stale-response guards are unchanged. No styling, wire format, or provider-specific execution changes.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The account section remains unavailable for folder workspaces, as before. This fixes redundant settings requests; it does not establish the cause of the intermittent Codex typing pause.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd1626a0-fbaf-46eb-b993-98ae21930aef
📥 Commits

Reviewing files that changed from the base of the PR and between e381443 and b387ccd.

📒 Files selected for processing (4)
  • src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx
  • src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx
  • src/renderer/src/components/settings/RepositoryGitHubAccountSection.tsx
  • src/renderer/src/components/settings/repository-github-account.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The repository account section now requests bindable accounts with the repository ID and path. It reuses inventory across display-name edits and reloads when repository scope or runtime inputs change. The tests cover forced refresh, stale responses, and binding callbacks that use the latest repository.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b387c

This change avoids redundant GitHub account refreshes while editing project names and reloads when the relevant scope changes. No merge-blocking risk was found; SSH and WSL hosts were not exercised, which is a normal validation gap.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: preventing GitHub account lookups from restarting when a project name changes.
Description check ✅ Passed The description covers the required change, rationale, visual proof, testing, review, and checklist. It explains why no issue is linked; the template permits maintainers to avoid opening needless issu…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 2d1ab8b into main Oct 8, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant