Repository navigation
Description
Summary
Since the PR-tools instruction added in #26751, a Codex agent can refuse to create a PR in a second repository even when the user explicitly requests gh, GitHub CLI authentication works, and the prepared branch is already pushed. The listed pull_request_create tool only operates on the thread's bound checkout, while the injected instruction forbids the working CLI alternative.
This report concerns the instruction-level deadlock, not a request to add cross-repository targeting to pull_request_create or to rebind a thread. The latter capability request was closed as not planned in #40463. A CLI fallback would resolve this bug without adding that feature.
Area
apps/server — host-injected runtime instructions / source-control MCP tools
Steps to reproduce
These steps describe the observed live session; they were not rerun as an isolated automated test.
- Start a Codex thread associated with repository A, on a supported GitHub host, so T3 lists its
pull_request_*tools. - Have the agent prepare, commit, and push a branch in repository B, using a separate local checkout/worktree. Keep repository B's primary checkout on
main. - Confirm the CLI route is available:
gh api usersucceeds andgh repo view owner/repo-b --json viewerPermission,isArchivedreportsWRITEandfalse. - Ask the agent to create the PR in repository B. Explicitly request
gh pr create --repo owner/repo-b --head fix/example --base mainwhen it says the T3 create tool targets repository A. - Observe that the agent refuses the CLI fallback because
pull_request_*tools are listed, although the create tool cannot select repository B, its head branch, or its worktree.
Expected behavior
The agent can complete user-authorized PR creation through gh when the listed T3 tool cannot target the requested checkout. The instruction should require T3 tools only when they support the actual requested operation, with a CLI fallback otherwise. The resulting PR can still be linked through link_pull_request.
Actual behavior
Repeated explicit requests to use gh produce refusals citing the T3 runtime instruction. The branch is pushed successfully, but the PR is left uncreated and the user is given a manual command or GitHub creation link.
This is not a CLI authentication, sandbox, or GitHub write-permission denial. The agent stops before sending a PR creation request. We intentionally did not call pull_request_create against the wrong repository as a reproduction step.
Source evidence
Inspected upstream at 58e309e75b8f2fb2ad824a6437bfa920ab5398e9:
runtimeInstructions.tsmandates T3 PR tools whenever they are listed, with no unsupported-target fallback.CodexDeveloperInstructions.tssupplies the rule throught3_code_runtimeadditional context.pull_request_createhandler selectsthread.worktreePath ?? project.workspaceRoot; the available tool schema has no repository/head/cwd override.- The CLI-replacement mandate was added by commit 5d05902, committed November 19, 2026 UTC, in feat(server): agents read, open, update, respond to, and merge PRs through MCP tools #26751. chore(server): PR tool descriptions stop steering away from gh and cafe #39947 explicitly retained it.
Impact
Blocks PR creation through the agent for a prepared branch outside the thread's associated repository, despite an authenticated CLI with write access. The existing manual CLI route remains available to the user.
Version and environment
- Running T3 server:
0.1.11 - macOS, arm64
- Codex harness; observed with GPT-6.1 Terra and GPT-6.1 Sol
- Current thread runtime mode:
full-access - CLI authentication and target-repository
WRITEpermission directly verified
Related reports
- Allow PR creation from an existing prepared branch outside the bound thread checkout #40463: explicit head/worktree selection for PR creation, closed as a feature request. This report asks for fallback to an existing CLI capability instead.
- [Bug]: Mandatory PR watcher blocks custom VCS/CI workflows; allow custom providers or full opt-out #22369: broader open report about mandatory injected PR workflow instructions blocking unsupported workflows.
- [Bug]: OpenCode external-server threads receive mandatory instructions for unavailable T3 PR tools #35588: mandatory instructions supplied when PR tools are unavailable. Here the tools are listed, but cannot target the requested checkout.
Workaround
Run gh pr create --repo owner/repo-b --head fix/example --base main manually. Repeatedly authorizing the agent to use that route does not resolve the injected instruction conflict in the affected session.
Private repository names, user/account identifiers, local paths, and session identifiers are omitted.
Prepared by GPT-6.1 Sol through the Codex harness in T3 Code, at the user's request.
Activity
juliusmarminge commentedon Nov 23, 2026
I tried to reproduce this on the current build and could not.
Commit 49ce71e (origin/main). Server: dev server started with T3CODE_DEV_SEED=0, fresh database, a stub
ghon PATH that logged each call and answeredgh pr createwith a fake PR URL. Data: two local git repos with origin https://github.com/acme/repo-a.git and https://github.com/acme/repo-b.git; repo-b had branch fix/example committed in a separate worktree while its primary checkout stayed on main; repo-a added as the project (t3 project add). Threads: started witht3 thread start --provider codex --model <m> --wait(runtime mode full-access). Check: in a separate Terra thread on the same project, the agent listed its tools, which included all T3 PR/CI tools: pull_request_create, _list, _read, _update, _respond, _review, merge, ci_logs, ci_rerun, link/watch tools. The Codex rollout carried the unchanged <pull_request_linking> rule 'When pull_request* tools are listed, use them, not gh or cafe'. Runs: (1) gpt-6.1-sol, asked to open the repo-b PR and explicitly told to usegh pr create --repo acme/repo-b --head fix/example --base main; it ran exactly that, then called link_pull_request. (2) gpt-6.1-sol ×2 and gpt-6.1-terra ×2, asked only to create the PR in acme/repo-b against main, with no mention of gh; all 4 rangh pr create --repo acme/repo-b --head fix/example --base main ...themselves; none refused and none called pull_request_create against repo-a. 5/5 created the PR through gh. The runtime instruction text is identical at the reporter's commit 58e309e and at main. Not replicated: the reporter's long live session with repeated pushback, which may have carried context that made the model refuse.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.