Show PRs from all repositories and worktrees touched by a CLI thread
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
CLI (TUI)
What feature would you like to see?
I would like the existing pull-request-number status-line item to show open pull requests from every Git checkout that is relevant to the current thread, rather than only the pull request associated with the current working directory.
A thread can interact with more than one checkout in several common workflows:
- Codex or the user creates multiple Git worktrees for parallel changes.
- Commands run with a
cwdin another worktree of the current repository. - Commands run in a different repository during the same thread.
- A resumed thread contains historical command executions from those directories.
The status line should discover pull requests from:
- The current thread cwd.
- Working directories used by command-execution items in the current thread, including replayed history.
- All worktrees belonging to repositories identified by those directories.
When multiple pull requests are found, the existing single-line footer could render compact labels such as:
PR #123, PR #456
For pull requests from different repositories on the same host:
openai/codex#123, example/api#456
For different hosts, the host could also be included. Each label should link independently to its own pull request.
This should not increase the footer height or change the default status-line configuration. Existing git-branch and branch-changes items should remain scoped to the current cwd.
Additional information
The current pull-request-number lookup is useful for a single checkout, but it becomes incomplete during a long-running thread that coordinates several worktrees or projects. A pull request created in a sibling worktree can remain invisible even though it is part of the active conversation.
To keep the lookup bounded and avoid affecting TUI responsiveness, a possible implementation would:
- Track only directories observed from the thread cwd and command execution cwd fields; do not scan arbitrary workspace roots or paths mentioned only in text.
- Prioritize the current cwd, then touched directories in most-recently-used order, then automatically discovered worktrees.
- Cap the number of checkouts, for example at 16.
- Limit concurrent pull-request probes, for example to 4.
- Refresh after session/configuration changes, cwd changes, and turn completion or interruption rather than polling continuously.
- Omit failed probes and non-open pull requests on a best-effort basis.
- Deduplicate pull requests by normalized URL.
- Ignore stale asynchronous results after a thread or cwd change.
I have a working proof of concept with tests and an insta snapshot here:
- Branch: https://github.com/jerboy/codex/tree/feat/session-worktree-pr-status
- Comparison: https://github.com/openai/codex/compare/main...jerboy:feat/session-worktree-pr-status
The proof of concept keeps the footer single-line and gives every PR label an independent OSC 8 hyperlink.
I understand that external code contributions are by invitation only. I am filing this issue first to ask whether the behavior and proposed scope align with the maintainers intended direction, and whether the team would be willing to invite a pull request if the approach is acceptable.
Related issues:
- #23473: current PR lookup not rendering in some environments
- #30255: making the current PR number clickable
- #22697: additional Git-related status-line items
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing pull-request-number status-line lookup and review the referenced proof-of-concept branch, including its tests and insta snapshot. Compare the behavior against the requested thread directories, worktrees, refresh limits, deduplication, and independent links; done means relevant open PRs appear in one unchanged-height footer without widening the existing git status scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100