codex - 💡(How to fix) Fix PR status line does not show open PR even though gh pr view succeeds [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#23473Fetched 2026-05-20 03:49:21
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4unlabeled ×1

Code Example

[tui]
status_line = [
  "model-with-reasoning",
  "git-branch",
  "context-remaining",
  "five-hour-limit",
  "weekly-limit",
  "pull-request-number",
  "task-progress"
]
status_line_use_colors = true

---

gh pr view --json number,url,state,headRefName,headRefOid

---

{
  "number": 123,
  "state": "OPEN",
  "url": "https://github.com/<org>/<repo>/pull/123",
  "headRefName": "feature/example-branch",
  "headRefOid": "<head-sha>"
}

---

env GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 gh pr view --json number,url,state
env GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 /opt/homebrew/bin/gh pr view --json number,url,state
RAW_BUFFERClick to expand / collapse

Environment

  • Codex CLI: codex-cli 0.131.0
  • Platform: macOS
  • Repository: private GitHub repository
  • GitHub CLI is authenticated with an account that has access to the private repository.

Config

~/.codex/config.toml:

[tui]
status_line = [
  "model-with-reasoning",
  "git-branch",
  "context-remaining",
  "five-hour-limit",
  "weekly-limit",
  "pull-request-number",
  "task-progress"
]
status_line_use_colors = true

Reproduction

  1. Open Codex CLI in a local branch that has an open GitHub PR.
  2. Confirm the PR is discoverable from the same cwd:
gh pr view --json number,url,state,headRefName,headRefOid

Example successful output:

{
  "number": 123,
  "state": "OPEN",
  "url": "https://github.com/<org>/<repo>/pull/123",
  "headRefName": "feature/example-branch",
  "headRefOid": "<head-sha>"
}
  1. Confirm it also works with the same prompt-disabled env used by Codex status probes:
env GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 gh pr view --json number,url,state
env GH_PROMPT_DISABLED=1 GIT_TERMINAL_PROMPT=0 /opt/homebrew/bin/gh pr view --json number,url,state

Both return the open PR.

Expected Behavior

The TUI status line should render PR #123 when pull-request-number is enabled.

The Codex App PR panel should also detect the open PR, or report the failed lookup reason.

Actual Behavior

  • Codex CLI status line does not show the PR number.
  • Codex App shows Pull request status unavailable.
  • Manual gh pr view succeeds from the same repo/cwd.

Notes

From the public source, pull-request-number appears to use gh pr view --json number,url,state via the status-line git summary path:

  • codex-rs/tui/src/branch_summary.rs
  • codex-rs/tui/src/chatwidget/status_surfaces.rs

Since the same command succeeds manually, this looks like the status-line/App PR lookup is not refreshing, not receiving the git summary result, or is using a different execution context than the user shell.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix PR status line does not show open PR even though gh pr view succeeds [1 participants]