fix(server): sync linked PR status on hosts without the stacks API #14460
main fromrefs/pull/14460/head·opened View on GitHubWhat Changed#
VcsProcess.classifyNonZeroExit now classifies a gh failure whose stderr contains HTTP 404 as not-found. That lets the existing GitHubPullRequestNotFoundError fallback in getPullRequestStack run, so a host that does not serve the stacks endpoint is read as "not stacked" instead of a failed lookup.
One regression test feeds the raw gh: Not Found (HTTP 404) process output through VcsProcess and asserts the not-found classification without retaining stderr.
Why#
On a GitHub Enterprise Server release without native stacks, the ordinary PR read succeeds and reports merged, but gh api .../stacks?pull_request=N exits with gh: Not Found (HTTP 404). The process boundary only recognized the GraphQL not-found messages for gh, so this came back as command-failed. getPullRequestStack already documents 404 as "no stack", but the fallback never ran.
PullRequestSyncReactor.syncGroup deliberately withholds a snapshot until the stack answer arrives, so sibling layers are linked before a terminal snapshot can settle the thread. With the stack read failing forever, the merged summary was never persisted: the detail panel showed Merged while the sidebar badge stayed pending and the thread never settled. The panel also kept offering Retry stack lookup.
Fixing the classification is the smallest change that restores the intended flow. The reactor's hold-until-stack-known behavior is unchanged, so a genuine transient failure still preserves the previously synced stack and retries.
Authentication, rate-limit, and transient failures are not affected: they match earlier branches of the classifier and still reach the stack read as errors, which keep a known stack and retry. An access-scoped 404 cannot be mistaken for "unstacked" in practice, because both callers (the sync reactor and the detail panel read) only ask for the stack after a summary read of the same PR on the same host and credentials succeeded.
Related: #12645 takes the same classification change and adds an extra access-probe request per stack read. This PR is the minimal version.
Validation#
vp test runforVcsProcess.test.ts,GitHubCli.test.ts,GitHubPullRequestCli.test.ts, andPullRequestSyncReactor.test.ts: 186 passed. The new test fails onmainwithfailureKind: "command-failed".- Server
tsc --noEmit, targetedvp lint, andvp fmt --checkpass on the changed files.
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes (no UI change)
- I included a video for animation/interaction changes (not applicable)
Fixes #14458
Diagnosed and implemented with Claude Fable 5.1 in Claude Code.
- 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
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
62f1fd7Macroscope's review found this PR approvable — This is a small, focused server bug fix that maps unsupported
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).ghstack endpoints to the existing “not stacked” fallback, with a targeted regression test. It does not alter defaults, schemas, deployment behavior, or static-analysis settings.Note
Written by
claude-opus-5-5on behalf of MariaThanks for this. I'm closing it as part of PR triage. This is already fixed on main.
From the review: Stack reads on main already classify HTTP 404 responses directly and return no stack, allowing linked pull request status to sync on hosts without the stacks API.
If you think this was a mistake, message me on Twitter at @maria_rcks and I'll take another look.
maria-rcks closed this
Sign in to join this conversation.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
ec03d0c1-7a70-4d7c-a5c8-d1aab33d1be8📥 Commits
Reviewing files that changed from the base of the PR and between c2fa9fc911daeac97df4760f95fc57dca42b84c8 and 62f1fd70baf530718d1353c6dab2a96c098dd031.
📒 Files selected for processing (2)
apps/server/src/vcs/VcsProcess.test.tsapps/server/src/vcs/VcsProcess.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
VcsProcessnow classifiesgh apifailures containinghttp 404asnot-found. A test verifies the failure kind and confirms that the error message excludes provider stderr.Changes#
GitHub API 404 classification
apps/server/src/vcs/VcsProcess.ts,apps/server/src/vcs/VcsProcess.test.tsghnot-found classification now matcheshttp 404. The test checks theVcsProcessExitErrorfailure kind and confirms its message excludes provider stderr.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
saphidMerge Risk: ⚪ Minimal · up to
62f1fThe change allows PR status synchronization on hosts without the stacks endpoint while preserving ordinary PR-read failure handling. No actionable merge-blocking risk remains after normal checks.
Security Architecture Review#
Security architecture risk: 🔵 Low · up to
62f1fThis restores synchronization on hosts without stack support. No permission bypass or new data exposure was demonstrated, but a 404 is accepted as a final no-stack answer without establishing every possible cause.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
#14458requires unsupported GitHub Enterprise stacks responses to stop blocking ordinary PR synchronization while preserving authentication, rate-limit, and transient failure handling. `VcsProce…VcsProcess.classifyNonZeroExitand its regression test. These changes directly support issue#14458by enabling the existing missing-stack fallback. No unrelated produc…✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.