Skip to content

[Bug]: PR and CI MCP tools return errors telling callers to "Pass url" or "Pass host or url" despite having neither parameter #41394

Done

Description

@zbynekwinkler

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 project with forge PR tools enabled (pull_request_read, pull_request_update, pull_request_respond, pull_request_review, pull_request_merge, ci_logs, ci_rerun).
  2. Trigger any target-resolution error in locate(), for example:

Expected behavior

Error messages from tools using ThreadPullRequestInput should only suggest parameters those tools actually accept (number, repository), or explain that the thread's project remote could not be resolved — never tell the caller to pass url or host (unless those tools are changed to accept url).

Actual behavior

All seven ThreadPullRequestInput tools propagate PullRequestTargetError messages verbatim from resolveTarget:

  • PullRequestUrlUnavailableError: "This thread's project is on a host with no known pull request URL shape. Pass url."
  • PullRequestHostRequiredError: "This thread's project has no recognised remote. Pass host or url."
  • PullRequestTargetIncompleteError: "Pass either url, or both repository and number."

None of those seven tools defines a url or host parameter in its schema, so following the error message either fails MCP parameter validation or forces the agent to abandon the tool and fall back to raw CLI commands.

Cause

ThreadPullRequestInput in apps/server/src/mcp/toolkits/pullRequests/tools.ts (lines 498–503) only declares:

export const ThreadPullRequestInput = Schema.Struct({
  environmentId: OrchestratorMcpEnvironmentTarget,
  number: Schema.optional(PositiveInt.annotate({ description: "Default: the branch's PR." })),
  repository: Schema.optional(TrimmedNonEmptyString),
});

This schema is shared by pull_request_read, pull_request_update, pull_request_respond, pull_request_review, pull_request_merge, ci_logs, and ci_rerun.

All seven handlers resolve their target through locate() in apps/server/src/mcp/toolkits/pullRequests/handlers.ts (lines 511–552), which calls resolveTarget(named, project) in apps/server/src/pullRequest/pullRequestTarget.ts (lines 78–123). resolveTarget and its error messages (lines 25–50) were written for PullRequestTargetInput (link_pull_request, unlink_pull_request, watch_pull_request, unwatch_pull_request, write_pull_request_guides, read_pull_request_guide), which do accept url and host, and locate() propagates those errors without adapting them to ThreadPullRequestInput.

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

Ignore the "Pass url" suggestion; pass only number (or number plus repository in owner/repo format without a host prefix).


Analyzed and drafted with Gemini 4 Neon (Antigravity).

Activity

  1. Luzivog commented on Nov 23, 2026

    @Luzivog
    Contributor

    Reproducing on 0.1.12-nightly.20261122.5111 with watch_pull_request and unwatch_pull_request:

    • In a 24h audit (2,993 runs), 16 calls (13 watch_pull_request, 3 unwatch_pull_request) failed with Pass either url, or both repository and number when agents passed only {"number": <N>}, expecting thread-repository inference consistent with pull_request_read, pull_request_merge, and link_pull_request.
    • Inferring repository from the calling thread's workspace/branch (matching the other PR tools) would remove all 16 failures.
  2. juliusmarminge commented on Nov 23, 2026

    @juliusmarminge
    Member

    #41397, now on main: The reported host-prefixed repository call on a known GitHub forge now says to pass repository as owner/repo without the host, rather than suggesting an unsupported url parameter.

    Not done: Unknown-host, missing-remote and incomplete-target failures still propagate messages suggesting url or host to PR and CI tools that accept neither parameter.

    Closing; open a new issue if what is left still matters to you.

  3. juliusmarminge commented on Nov 23, 2026

    @juliusmarminge
    Member

    #41414, now on main: PR and CI tools now resolve cold or cached-unknown project identities through the refined forge, eliminating the reported target-resolution failure when forge detection succeeds.

    Not done: Other target-resolution failures still propagate advice to pass url or host, although these tools accept neither parameter.

    Closing; open a new issue if what is left still matters to you.

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