GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: resolveTarget misreports an invalid or host-prefixed repository as an unknown host ("no known pull request URL shape") · Issue #41385 · pingdotgg/t3code

[Bug]: resolveTarget misreports an invalid or host-prefixed repository as an unknown host ("no known pull request URL shape") #41385

New issue
Copy link
New issue
Copy link
Closed
#41397
Closed
[Bug]: resolveTarget misreports an invalid or host-prefixed repository as an unknown host ("no known pull request URL shape")#41385
#41397
Copy link

Description

@zbynekwinkler
zbynekwinkler
opened on Nov 23, 2026
Issue body actions

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Open a thread in a GitHub or GitHub Enterprise Server project whose repositoryIdentity.provider is already resolved to "github" (for example, https://gh.example.internal/org/repo.git authenticated via gh, or any github.com/org/repo project).
  2. Invoke any MCP tool that goes through resolveTarget with a repository value that is not strictly owner/repo — for example, a host-prefixed gh --repo-style selector or a single-segment name:
    • pull_request_respond({ number: 123, repository: "gh.example.internal/org/repo", body: "test" })
    • or link_pull_request({ repository: "github.com/org/repo", number: 123 })

Expected behavior

resolveTarget distinguishes between:

  • an unknown forge host (kind === null or kind === "unknown"), and
  • a known forge whose changeRequestUrl rejected the repository value.

For a known GitHub host, it should either return a clear validation error stating that repository must be in owner/repo format (without the hostname), or normalize a matching <host>/owner/repo prefix.

Actual behavior

The call fails with PullRequestUrlUnavailableError:

This thread's project is on a host with no known pull request URL shape. Pass url.

This happens even though the project's host is recognized as "github". The misleading message causes both agents and users to think host/GHES detection failed, rather than realizing repository had an unexpected format (3 segments instead of 2).

Cause

In apps/server/src/pullRequest/pullRequestTarget.ts (resolveTarget, lines 104–118), url === null is treated unconditionally as an unknown host URL shape:

const url =
  kind === null
    ? null
    : sourceControlDefinitions.get(kind).changeRequestUrl({
        host,
        repository,
        number: input.number,
        remoteUrl: project?.repositoryIdentity?.locator.remoteUrl,
      });
if (url === null) {
  return yield* new PullRequestUrlUnavailableError({});
}

In packages/source-control-github/src/shared/definition.ts (lines 40–48 and 88–97), changeRequestUrl returns null whenever isRepositoryPath(repository) is false (i.e., repository.split("/").length !== 2 or invalid characters). Because resolveTarget does not check kind === null || kind === "unknown" separately from definition.changeRequestUrl(...) === null, a malformed repository string on a recognized GitHub/GHES project surfaces as PullRequestUrlUnavailableError.

Impact

Minor bug or occasional failure

Version or commit

Reproduced on v0.1.11; confirmed identical on main @ d63b9c4c76.

Environment

Linux, T3 Code v0.1.11 (Desktop / Web), Codex (gpt-6.2-sol), GitHub Enterprise Server authenticated via gh.

Logs or stack traces

Tool call:
t3-code.pull_request_respond({
  "number": 123,
  "repository": "gh.example.internal/org/repo",
  "body": "..."
})

Tool output:
This thread's project is on a host with no known pull request URL shape. Pass url.

Workaround

Pass repository as owner/repo without the host prefix (e.g., "org/repo"), or omit repository on thread-scoped PR tools so it defaults to the project's repository.


Analyzed and drafted with Gemini 4 Neon (Antigravity).

Activity

  1. juliusmarminge
    closed this as completedin #41397on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.