[codex] Make background VCS fetch non-interactive #3133
main fromrefs/pull/3133/head·merged by juliusmarminge View on GitHubWhat Changed#
Background upstream status fetches now run with non-interactive Git auth env vars, not just the SSH askpass guard. The status-refresh fetch already had SSH_ASKPASS_REQUIRE=never; this adds GCM_INTERACTIVE=never, GIT_TERMINAL_PROMPT=0, and empty GIT_ASKPASS/SSH_ASKPASS for that same passive fetch path.
Why#
This keeps passive VCS polling from opening credential UI. The earlier fetch interval work helps users slow down or disable background fetches, but Windows HTTPS remotes can still go through Git Credential Manager. If GCM doesn't have a cached credential, it can open a GitHub auth window from a background status refresh. That window can then get killed by the short fetch timeout and reopen on the next poll. For background status checks, failing quietly is better than stealing focus. Explicit user actions like pull, push, and manual fetch still use the normal environment.
User Workaround#
Users can usually fix their local GitHub HTTPS setup by authenticating Git directly, for example with gh auth setup-git if they already use GitHub CLI, or by logging into Git Credential Manager outside T3 Code. That still leaves an app-side problem though: passive polling should not be the thing that starts an interactive auth flow. If credentials are missing, the background refresh should fail quietly and let an explicit Git action handle authentication.
Tradeoff#
When credentials are not already available, passive remote status may fail quietly and ahead/behind counts can stay stale until the user authenticates through an explicit Git action or disables/re-enables background fetching. That is intentional here: background polling should not steal focus or spawn short-lived auth windows.
UI Changes#
None.
Checklist#
- This PR is small and focused
- I explained what changed and why
Validation#
pnpm --filter t3 exec vp test run src/vcs/GitVcsDriverCore.test.ts --reporter=dotpnpm exec vp checkpnpm exec vp run typecheck
Note
Make background VCS fetch non-interactive by setting additional environment variables#
Adds GCM_INTERACTIVE=never, GIT_ASKPASS="", GIT_TERMINAL_PROMPT=0, and SSH_ASKPASS="" to GitVcsDriverCore.STATUS_UPSTREAM_REFRESH_ENV alongside the existing SSH_ASKPASS_REQUIRE=never. The test in GitVcsDriverCore.test.ts is updated to verify all five variables are set to non-interactive values and to restore them after execution.
Note
Low Risk Scoped to cached background status fetches only; user-initiated pull/push/fetch paths are unchanged.
Overview
Background upstream status refreshes now run Git with a fuller non-interactive env overlay, not only SSH_ASKPASS_REQUIRE=never. The passive fetchRemoteForStatus path sets GCM_INTERACTIVE=never, GIT_TERMINAL_PROMPT=0, and clears GIT_ASKPASS / SSH_ASKPASS so polling does not open GCM or terminal credential UI (e.g. on Windows HTTPS).
Explicit user Git actions still use the normal process environment. If credentials are missing, background refresh is expected to fail quietly and ahead/behind may stay stale until the user authenticates via an explicit action.
The integration test was broadened to assert all of these vars reach the child Git/SSH process when statusDetails triggers upstream refresh.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
This is the window I was seeing from passive status polling. Because the background fetch times out, the auth window opens for a few seconds, closes, then reopens on the next poll.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved
Adds standard git environment variables to disable interactive prompts during background VCS fetch operations. The change is additive to an existing configuration object, with clear intent and minimal risk.
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).juliusmarminge merged this75b3b3c
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
df35b7a2-ef53-440f-a476-ebc6811eb182You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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