openai / openai/codex

Codex app: worktree branch/PR sidebar stays stale on task selection until a new message

Open
#43,531 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app bug
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.901.51231, build 8109 (read from the installed app's Info.plist; bundle identifier com.openai.codex).

What subscription do you have?

Not provided; can add if needed for diagnosis.

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

The Environment side panel can show stale branch/PR information for existing worktree tasks. Selecting a task with an open PR does not populate its PR row. In the captured example the panel showed main, Changes +0 -0, and Compare branch, even though the task's actual worktree was on its pushed feature branch with an open PR.

After quitting and reopening the app, then sending a new message in that task, its panel updated. Selecting several other existing worktree tasks in the same project still left their PR rows absent. Requiring another model turn to refresh repository UI is unexpected.

The new-message recovery sequence is a user observation. Sending a message in every other affected task has not been tested, and it is not yet established whether a message alone, without restarting, is sufficient.

What steps can reproduce the bug?
  1. Use one local GitHub project with multiple Codex tasks in separate managed Git worktrees.
  2. In each worktree, check out a feature branch, push commits, and open a PR. The observed PRs were created/pushed through the agent/CLI workflow.
  3. Leave those tasks idle, quit and reopen the desktop app, and select an existing task without sending a message.
  4. Inspect the Environment panel's branch, change summary, and PR row.
  5. Compare with read-only commands executed from that exact worktree:
git branch --show-current
git rev-parse HEAD
gh pr view --json number,headRefName,headRefOid,state,url

Observed: the panel can remain on main / Compare branch or omit the PR row while these commands show the correct feature branch and an OPEN PR. In the reported recovery sequence, sending a new message after relaunch made one task's panel update; selecting other affected tasks did not.

What is the expected behavior?

Selecting or restoring an existing task should resolve that task's current worktree and display the corresponding branch and PR without requiring a new message or model run. Tasks sharing a Git common directory must retain their distinct worktree identities.

Additional information

Read-only checks confirmed four affected/example tasks have correct worktree paths and feature-branch names in saved task metadata. For the three other worktrees checked after the report, gh pr view returned OPEN PRs whose head branches and commits matched the local checkouts. Thus the missing row is not explained by an absent/unpushed PR or a checkout actually on main.

Relevant installed renderer code locations (build-specific minified names; these are investigation leads, not a proven source-level root cause):

  • webview/assets/local-conversation-thread-40db5af470f5.js: UC selects Environment targets from task workspace state and resolved project sources; CC performs the branch/PR query; OS prefers currentBranch over recordedBranch; TC renders the Compare branch fallback.
  • webview/assets/app-initial-cadb12d4a15e.js: wTi reads thread-workspace-state-v1:<task-id> and returns pending/applied workspace cwd; NSr resolves Git query targets from metadata; Jho creates the current-branch query with infinite stale time and a live subscription conditional on retainRepoWatch; Bk also sets refetchOnWindowFocus: false.
  • webview/assets/app-primary-6cd7b8b3f5e3.js: xWe (export Yw, imported as lp by the Environment panel) connects the current-branch hook to that query path.

Please inspect task-open/restoration workspace hydration and Git-query subscription/invalidation, and compare them with the refresh performed when a new turn starts. Infinite stale time or disabled focus refetch alone does not establish a bug; a correct live subscription could make those settings intentional. No original TypeScript source path or live failing query arguments have been verified.

Environment disclosure: this installation has local modifications from a desktop-patch project, including PR auto-fix monitoring and renderer integration. A reproduction on an unmodified build is not yet available, so patch interaction has not been ruled out. The monitor can resolve/watch a PR while the native panel omits it, but that is a separate lookup path and does not prove native attachment state. An attempted independent UI inspection failed to start; the visual sequence above is based on the user's screenshot and observations, while Git/metadata checks and code locations were independently verified. No app files or task state were modified for this report.

Searched existing issues for PR/sidebar refresh, worktree/main/stale, and branch/sidebar. #25392 concerns historical closed/merged PR selection for an actual main checkout; this report concerns a feature-worktree task whose panel fails to refresh its current branch/PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mentioned renderer bundles: trace task workspace hydration through wTi and NSr, then follow the current-branch query through Jho, Bk, xWe, UC, CC, OS, and TC. Compare task restoration with the refresh path triggered by a new turn, using the listed read-only Git and gh commands to verify the worktree; done means selecting an existing task shows its current branch and matching open PR without sending a message.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github, javascript
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.