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
- 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).
- 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).