openai / openai/codex

Codex Desktop Changes counter persists across old project conversations after commit, push, and restart

Open
#42,775 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What version of the Codex App are you using?

26.901.31953 (build 7868)

What subscription do you have?

Paid ChatGPT subscription. This appears independent of subscription tier.

What platform is your computer?

macOS 26.7 (Build 25G224), arm64 (Apple Silicon)

What issue are you seeing?

Codex Desktop's Environment panel shows a large green/red “Changes” count in every existing conversation for a local project even after all changes have been committed and pushed, the working tree is clean, the branch exactly matches its upstream, the obsolete remote has been removed, and the app has been fully restarted and updated.

In this case the panel continued to show +20,669 -6,924. Git reported:

## main...gitea/main

and the branch was 0 ahead / 0 behind with empty staged, unstaged, and untracked diffs.

Read-only inspection of Codex's local state showed that existing conversations retained the Git SHA captured when each conversation was created. Different conversations in the same project stored many historical threads.git_sha values. A newly created conversation stored current HEAD, while older conversations continued comparing against their historical SHA after commit, push, app restart, and app update.

The only effective local workaround was to back up Codex's state database and manually update all conversation git_sha values for that project to current HEAD. Users should never need to modify Codex's internal SQLite state to make a Git status indicator reflect a clean repository.

This is especially misleading because the counter is labeled “Changes” and appears beside branch and commit/push controls. It looks like actionable current repository state, not an immutable diff from when each conversation happened.

What steps can reproduce the bug?
  1. Open a local Git repository as a Codex project and create several conversations at commit A.

  2. Make a substantial set of edits in one or more conversations.

  3. Commit all changes as commit B and push B to the tracked upstream.

  4. Verify that the worktree is clean and synchronized:

    git status --short --branch
    ## main...origin/main
    
    git diff --stat
    (empty)
    
    git diff --cached --stat
    (empty)
    
    git rev-list --left-right --count origin/main...HEAD
    0  0
    
  5. Open conversations in the project that were created at commit A.

  6. Observe that the Environment panel still shows the entire A-to-B addition/deletion count as “Changes.”

  7. Fully quit and restart Codex Desktop, and update the app if an update is available.

  8. Reopen those conversations and observe that the historical count remains.

  9. Create a new conversation at commit B and observe that it uses B as its base, unlike the older conversations.

What is the expected behavior?

The Environment panel should represent current actionable Git state. Once changes are committed and the branch matches its upstream, it should show zero changes in every conversation for that project.

If Codex intentionally preserves a historical per-conversation comparison, it should not be labeled simply “Changes” beside current Git controls. It should be clearly labeled “Changes since this conversation started,” visually separated from working-tree status, and provide a supported action to advance/reset the comparison baseline after a commit or push.

Additional information

This is related to, but distinct from:

  • #31528, where stale local changes clear after a full app restart. In this case a restart and app update do not clear the count because historical conversation SHAs persist.
  • #30740, which mentions older thread rows retaining old git_sha values as a side observation in a broader native GitHub refresh report. This issue focuses specifically on the persistent Environment “Changes” counter across existing project conversations.

The underlying repository was healthy. Changing/removing remotes and resetting the tracked upstream did not affect the counter. The persisted per-conversation base SHA did.

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 at the Codex Desktop Environment panel and reproduce the issue using the listed Git commit, push, restart, and reopen steps. Inspect the persisted SQLite conversation state, especially historical threads.git_sha values, and compare the displayed counter with current repository status; done means existing conversations show zero actionable changes after the branch is clean and synchronized.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, macos, rust, sqlite
Domain
databases, desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.