Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

[codex] Canonicalize PR number references (#1749)

Danila Yudincd7980b4574a
diff --git a/apps/web/src/pullRequestReference.test.ts b/apps/web/src/pullRequestReference.test.ts
index e3e870cf1..2a1ed5207 100644
--- a/apps/web/src/pullRequestReference.test.ts
+++ b/apps/web/src/pullRequestReference.test.ts
@@ -14,7 +14,7 @@ describe("parsePullRequestReference", () => {
});
it("accepts #number references", () => {
- expect(parsePullRequestReference("#42")).toBe("#42");
+ expect(parsePullRequestReference("#42")).toBe("42");
});
it("accepts gh pr checkout commands with raw numbers", () => {
@@ -22,7 +22,7 @@ describe("parsePullRequestReference", () => {
});
it("accepts gh pr checkout commands with #number references", () => {
- expect(parsePullRequestReference("gh pr checkout #42")).toBe("#42");
+ expect(parsePullRequestReference("gh pr checkout #42")).toBe("42");
});
it("accepts gh pr checkout commands with GitHub pull request URLs", () => {
diff --git a/apps/web/src/pullRequestReference.ts b/apps/web/src/pullRequestReference.ts
index c775c1c66..b033db7d2 100644
--- a/apps/web/src/pullRequestReference.ts
+++ b/apps/web/src/pullRequestReference.ts
@@ -22,7 +22,7 @@ export function parsePullRequestReference(input: string): string | null {
const numberMatch = PULL_REQUEST_NUMBER_PATTERN.exec(normalizedInput);
if (numberMatch?.[1]) {
- return normalizedInput.startsWith("#") ? normalizedInput : numberMatch[1];
+ return numberMatch[1];
}
return null;