refactor(source-control): PullRequestService reads GitHub resolvers, not its kind (#17619)

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Opus 5.5 authored and GitHub committed 2026-10-09 16:22:36 -07:00
1 parent 49f849ecce
commit 2ce3e4ae74
11 files changed
+49 -31

No files matched your search

@@ -1,3 +1,4 @@
import { removeAgentCredits } from "@t3tools/source-control-core/server/mergeMessage";
import * as Effect from "effect/Effect";
import type {
PullRequestActor,
@@ -7,7 +8,7 @@ import type {
PullRequestViewerPermissions,
} from "@t3tools/contracts";
import * as GitHubApi from "./GitHubApi.ts";
import * as SourceControlRateLimit from "@t3tools/source-control-core/server/SourceControlRateLimit";
import * as GitHubPullRequestApi from "./GitHubPullRequestApi.ts";
import {
PullRequestProviderError,
@@ -262,6 +263,7 @@ export const make = Effect.gen(function* () {
const provider: PullRequestProviderApi = {
kind: "github",
capabilities: CAPABILITIES,
mergeMessageRewrite: removeAgentCredits,
getRoutingIdentity: (input) =>
cli.getRoutingIdentity(input).pipe(Effect.mapError(fail("routeIdentity"))),
withVerifiedCredential: (input, use) =>
@@ -526,7 +528,7 @@ export const make = Effect.gen(function* () {
// comparison, so one read usually answers what used to take three. When that heavier read
// fails, the light access read still answers, withholding only update-branch.
return cli.getPullRequestDetail(input).pipe(
Effect.provideService(GitHubApi.AllowGitHubReserve, true),
Effect.provideService(SourceControlRateLimit.Interactive, true),
Effect.map((pullRequest) =>
gitHubViewerPermissions({
...pullRequest.viewerAccess,