Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): pull request tools say when repository is not owner/repo #41397

Mergediamshadmantaqi(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/41397/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 36 additions and 10 deletions.

x
0 of 3 viewed, 3 left
12 additions and 0 deletionsapps/server/src/mcp/toolkits/pullRequests/handlers.test.tsModified
View file
@@ -416,6 +416,18 @@
}),
​
+ it.effect("says when repository is not owner/repo on a known host", () =>
+ Effect.gen(function* () {
+ const harness = yield* makeHarness({ project: makeProject() });
+ const error = yield* harness
+ .call("link_pull_request", { repository: "github.com/org/repo", number: 1 })
+ .pipe(Effect.flip);
+ expect(error).toMatchObject({ _tag: "PullRequestRepositoryInvalidError" });
+ expect(error.message).toContain("owner/repo");
+ expect(yield* Ref.get(harness.commands)).toEqual([]);
+ }),
+ );
+​
it.effect("treats a duplicate link as alreadyLinked rather than an error", () =>
Effect.gen(function* () {
const harness = yield* makeHarness({
2 additions and 0 deletionsapps/server/src/mcp/toolkits/pullRequests/tools.tsModified
View file
@@ -38,6 +38,7 @@
PullRequestTargetIncompleteError,
PullRequestHostRequiredError,
PullRequestUrlUnavailableError,
+ PullRequestRepositoryInvalidError,
} from "../../../pullRequest/pullRequestTarget.ts";
import * as PullRequestService from "../../../pullRequest/PullRequestService.ts";