Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip PR lookup for unknown providers #5831

ClosedLucenx9(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/5831/headopened View on GitHub

Problem

Repositories without a recognized source-control remote still attempted PR metadata lookups during status refreshes. The provider registry returned the unsupported unknown provider, so each lookup failed and emitted repeated findLatestPrForHeadContext and PR lookup failed trace entries.

Fix

Resolve the source-control provider once per PR lookup and return a tagged, non-definitive result before calling listChangeRequests when its kind is unknown. That result starts on the short 20-second cache cadence, then follows the existing exponential backoff while provider detection remains non-definitive, capped at the healthy two-minute PR lookup cadence, and falls back to the last known PR instead of overwriting it. A definitive result clears the streak; known providers keep the existing lookup behavior. Focused regression tests cover repositories without remotes, provider refinement after the first short TTL, preserving backoff across a detection hiccup, and preserving an existing PR badge.

Testing

  • node_modules/.bin/vp test run apps/server/src/git/GitManager.test.ts (78 passed)
  • node_modules/.bin/vp lint --report-unused-disable-directives apps/server/src/git/GitManager.ts apps/server/src/git/GitManager.test.ts
  • node_modules/.bin/vp fmt --check apps/server/src/git/GitManager.ts apps/server/src/git/GitManager.test.ts
  • node_modules/.bin/vp run --filter t3 typecheck

Model: GPT-5.6 Sol Harness: Codex in T3 Code


Note

Low Risk Scoped to git status PR metadata caching and lookup gating; behavior for known providers is unchanged aside from clearer outcome tagging.

Overview Git status no longer calls hosting APIs when the source-control provider is unresolved, avoiding repeated failed listChangeRequests lookups for repos without a recognized remote.

GitManager now models PR lookup results with a PrLookupOutcome (Complete vs ProviderUnknown). When the resolved provider kind is unknown, findLatestPrForHeadContext returns ProviderUnknown immediately instead of hitting gh/similar. lookupStatusPr keeps showing the last known PR on that outcome rather than clearing the badge, and the PR lookup cache treats ProviderUnknown like a non-definitive attempt: short retry cadence with existing failure backoff, capped at the normal healthy lookup interval. Definitive Complete results still use the standard TTL and clear the failure streak.

Tests extend makeManager with a configurable provider kind and add coverage for no-remote repos, provider refinement after backoff, backoff preservation across detection hiccups, and sticky PR display while the provider is temporarily unknown.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c7bc6956531002875178c18f047d7fd8a4e0ef0e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Skip PR lookup API calls for unknown providers in GitManager

  • Adds PrLookupOutcome discriminated union (Complete | ProviderUnknown) so the cache can distinguish a definitive PR result from an unresolved provider state
  • findLatestPrForHeadContext now returns ProviderUnknown early when provider.kind is "unknown", avoiding any listChangeRequests calls
  • Cache TTL for unknown-provider outcomes uses Duration.min(nextPrLookupFailureTtl, PR_LOOKUP_CACHE_TTL) and does not clear the failure streak; only definitive results reset the streak
  • lookupStatusPr returns the last known PR (via resolveLastKnownPr) when the provider is unknown, instead of attempting a provider call
  • Behavioral Change: the backoff streak in prLookupCache is no longer cleared on unknown-provider results, so repeated unknown states will continue to increase backoff up to the healthy TTL cap
Macroscope summarized c7bc695.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: ba460634-9444-469a-b4bb-002ccd50ffa9

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: bbb1467018

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bbb1467018c1048022314ba3ff1158b40d314e4d. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at c7bc695

      Macroscope's review found this PR approvable — This is a focused GitManager bug fix that suppresses guaranteed PR API failures for unknown providers while preserving known behavior and last-known status. The localized production change is supported by targeted regression tests and introduces no schema, security, billing, or deployment impact.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. Codex Review: Didn't find any major issues. Breezy!

      Reviewed commit: 54e8fc3b5c

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    7. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 9e51853128

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    8. Codex Review: Didn't find any major issues. You're on a roll.

      Reviewed commit: 7b1ad6e860

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    9. Would be great to see this fixed, it's annoying seeing these errors for projects without a git remote (i.e. when using t3 more as a cowork agent than on a coding project).

    10. github-actions[bot](GitHub profile, opens in a new tab) removed labelsvouch:unvouched

    11. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    12. Updated this PR onto the current main branch. The conflict resolution preserves the default-branch cache key and inherited-upstream guard added by #7317 while carrying the unknown-provider outcome through those paths.

      Local verification:

      • vp test run apps/server/src/git/GitManager.test.ts (91 passed)
      • vp lint --report-unused-disable-directives apps/server/src/git/GitManager.ts apps/server/src/git/GitManager.test.ts
      • vp fmt --check apps/server/src/git/GitManager.ts apps/server/src/git/GitManager.test.ts
      • vp run --filter t3 typecheck

Sign in to join this conversation.