The best way to control Claude Code, Codex and more from any computer or phone
fix(shared): local-path remotes no longer crash legacy PR link projection (#13463)
Co-authored-by: Julius Marminge <julius0216@outlook.com> Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Pujitha Paladugu committed
Sep 28, 2026 at 18:00 UTC
38f3c62304bfe79ea6c9f75a17afb732b555f48d
2 files changed
+14
packages/shared/src/threadPullRequests.test.ts
+12
@@ -242,6 +242,18 @@ describe("legacyLinkedPullRequestOf", () => {
242
it("does not guess when the project identity is unavailable", () => {
243
expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, null)).toBeNull();
244
});
245
+ it("does not route links for a local-path remote with no host or provider", () => {
246
+ const localIdentity = {
247
+ canonicalKey: "/tmp/r/remote",
248
+ displayName: "remote",
249
+ locator: {
250
+ source: "git-remote" as const,
251
+ remoteName: "origin",
252
+ remoteUrl: "/tmp/r/remote.git",
253
+ },
254
+ };
255
+ expect(legacyLinkedPullRequestOf([link(7)], "project-1" as never, localIdentity)).toBeNull();
256
+ });
257
});
258
259
describe("resolveThreadPullRequestChains", () => {
packages/shared/src/threadPullRequests.ts
+2
@@ -157,7 +157,9 @@ export function legacyLinkedPullRequestOf(
157
identity: RepositoryIdentity | null | undefined,
158
): ThreadLinkedPullRequest | null {
159
if (!identity) return null;
160
+ // A local-path remote has no host segment and no provider, so there is no host to match.
161
const host = pullRequestHostOf(identity, identity.provider as SourceControlProviderKind);
162
+ if (typeof host !== "string") return null;
163
const repository = sourceControlRepositorySelector(identity);
164
if (repository === null) return null;
165
const azureKey =