Skip to content

[Bug]: PR MCP reads use the parent project's GitHub host for a GitLab repository #44041

Backlog

Description

@ngpestelos

Before submitting

  • I searched existing issues and did not find a duplicate of this cross-host routing failure.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Repository names, hosts and MR numbers below are anonymised placeholders.

  1. Register a parent project whose Git remote is on GitHub, for example github.com/example-org/workspace.
  2. Include an independent GitLab repository as a tracked folder, for example gitlab.example.com/example-team/service. Also register that folder as its own T3 project. Confirm that T3 recognises the parent project's provider as GitHub and the nested repository's provider as GitLab.
  3. In a thread belonging to the parent project, ask the agent to read a merge request in the GitLab repository.
  4. Call pull_request_read with a repository override:
{"number":123,"repository":"example-team/service"}
  1. Try supplying the full repository URL instead:
{"number":123,"repository":"https://gitlab.example.com/example-team/service"}

Expected behavior

The agent should be able to identify the GitLab MR unambiguously and read it through GitLab, even though the calling thread belongs to a GitHub project. An explicit MR URL or host override would provide that information.

Actual behavior

The owner/repo call is routed to GitHub using the parent project's host. It fails with a GitHub repository lookup error. An anonymised version of the observed error is:

Pull request operation detail failed: GitHub could not find the requested resource, or the credential cannot see it. GitHub said: Could not resolve to a Repository with the name 'example-team/service'. (at repository)

Passing the full repository URL fails before the read:

Pass repository as owner/repo, without the host.

The exposed tool schema has no host or url parameter, so the agent cannot specify the intended forge through this tool. GitLab CLI reads succeed with the existing authentication.

Source investigation

In the installed build:

  • ThreadPullRequestInput exposes environmentId, number and repository, but no host or url.
  • locate() passes the requested number and repository to resolveTarget(named, project), where project is the calling thread's parent project.
  • resolveTarget() takes the host from that project when no explicit host is supplied. Changing repository does not change the host.

Relevant source:

Related: #41394 and #41396 cover unsupported parameter advice and repository-format errors. This report concerns an explicit repository override being sent to the wrong forge in a mixed GitHub/GitLab workspace.

Impact

Minor bug or occasional failure

MR inspection through the PR tool is blocked in this workspace setup; the existing GitLab CLI remains usable. Only read operations were tested.

Version or commit

T3 Code 0.1.12, bundled commit ca81b7b97a1c.

Environment

macOS desktop app, Codex harness, GitHub parent project and a separate self-managed GitLab repository.

Workaround

Use the existing GitLab CLI with the correct host and repository explicitly selected.

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