[Bug]: `vcs.refreshStatus` waits on GitHub PR lookup; a slow or hung `gh` keeps "Some requests are slow" toasts coming #16237
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Make
ghslow or hanging for the server process: anyghon the server's PATH that doesn't return within 30s. (I hit it with an Omarchy mise stub that exec-loops, omacom/omarchy#7234; aghthat prompts or stalls on the network behaves the same.) - Open a GitHub-backed project in T3 Code desktop.
- Click around: sidebar, branch picker, window focus.
Expected behavior#
Branch and working-tree status refresh quickly. A slow PR lookup only delays the PR badge and doesn't produce a persistent warning.
Actual behavior#
A sticky "Some requests are slow" toast (timeout: 0) lists entries like vcs.refreshStatus · <requestId> Started 4:27:58 PM, and reappears on every refresh. Git status stays stale for 1–3 minutes.
Cause, from the 0.0.45 bundle:
src/vcs/VcsStatusBroadcaster.tsrefreshStatusawaitsworkflow.remoteStatusinsidewithRemoteWriteLock.src/git/GitManager.tsreadRemoteStatusawaitslookupStatusPr, which shells out togh.src/sourceControl/GitHubCli.tsexecuteRawspawns bare"gh"withDEFAULT_TIMEOUT_MS = 30_000;listPullRequestsByHeadcan run it 3 times sequentially (up to 90s). There is no setting for theghpath.- The web slow-RPC tracker (15s threshold) excludes
pullRequests.*and subscriptions but notvcs.refreshStatus, although that RPC performs a PR lookup internally.
Possible fix: #13052 (return local status first, run the remote/PR lookup in the background) addresses this trigger. Capping cumulative gh time per lookup would also help.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.45 (t3code-bin 0.0.45-1, Omarchy package of the desktop app)
Environment#
Omarchy 4.0.4 (Arch, Hyprland), Linux 7.2.5, github-cli 2.100.0 / mise gh 2.102.0
Logs or stack traces#
# server.trace.ndjson, ~2h window
ws.rpc.vcs.refreshStatus: 50 calls, avg 73.6s, max 171.9s, 40 over 15s
# span tree of one 90.0s call
VcsStatusBroadcaster.refreshStatus
remoteStatus > readRemoteStatus > lookupStatusPr (88.7s)
findLatestPrForHeadContext > GitHubCli.listPullRequestsByHead
processRunner.runProcessCore {process.command: "gh"} x3, each hitting the 30s timeout
# errors
Pull request operation list failed: GitHub CLI returned no login for the authenticated account.
GitHub CLI command failed.
Workaround#
Make gh on the server's PATH resolve to the real binary, then restart T3 Code.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
rubenmeza(GitHub profile, opens in a new tab) changed the title
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #22159. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: Git status can remain stale while a slow or hung gh lookup holds the refresh lock. If that part still matters to you, please open a new issue for that part only.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Triage#
Thanks for the traces and timings, @rubenmeza! They lined up closely with the code.
What I found#
vcs.refreshStatus(apps/server/src/vcs/VcsStatusBroadcaster.ts) holds the remote-status write lock and waits forworkflow.remoteStatusbefore returning, andreadRemoteStatusinGitManager.tswaits onlookupStatusPr. The WebSocket handler returns that effect directly, so the client timer runs untilghfinishes.state: "all"throughGitHubCli.listPullRequestsByHead.guardedReadruns the GraphQL budget query, then the head query, then falls back togh pr list, and each spawn uses bareghwith a 30s default timeout (apps/server/src/sourceControl/GitHubCli.ts). Three timeouts is roughly 90s, matching your 88.7slookupStatusPrspan. A second refresh queued on the lock explains the 171.9s max.apps/web/src/rpc/requestLatencyState.ts, which skips subscriptions andpullRequests.*but notvcs.refreshStatus. Focus/visibility and opening the branch menu (GitActionsControl.tsx) each schedule another refresh.invalidateStatus, which bumps the PR-lookup epoch, so the 20s–15min failure backoff never applies to focus or the branch picker. The periodic poll doesn't bump it. With a hunggh, each click-around repeats the full timeout sequence, which is why the toast keeps coming back.PullRequestService.list(GitHubPullRequestCli.ts), where agh auth token/gh api usertimeout becomesGitHubViewerLoginUnavailableError. Same brokengh, different RPC.ghand no quota pause.Likely fix area#
vcs.refreshStatuswithout waiting on fetch or the PR lookup, letting the existing subscription deliver remote results. Its review raised concerns about the cache behavior.ghfrom being re-run on every focus.vcs.refreshStatusfrom the slow tracker would hide the toast rather than the stall. Aghpath setting and a cap on totalghtime per lookup are separate options, and the inbox list error would need its own handling.ghthat returns promptly on the server'sPATHand restart T3 Code.A maintainer will decide on the fix direction.