codex - 💡(How to fix) Fix Commit / PR Controls Becoming Stale (app-server research) [2 comments, 2 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#17708Fetched 2026-04-14 05:41:12
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2renamed ×2

Root Cause

I also found that materialized fork responses might need a small fallback because the newly written fork summary may be blank for git metadata even when the source rollout already has branch/origin info.

Fix Action

Fix / Workaround

I validated a small fork patch that preserves thread.gitInfo across those paths without changing API shape.

I validated a narrow fork patch that:

  • hydrates thread.gitInfo from persisted thread metadata first
  • falls back to rollout-derived summary
  • returns None only when neither source has git metadata

Scope boundaries of the patch:

  • no new RPCs
  • no new Thread fields
  • no protocol/schema changes
  • no PR merge/closure detection
  • no changes to thread/metadata/update semantics
  • no changes to rollout git capture semantics
RAW_BUFFERClick to expand / collapse

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

26.409.20454 (1462)

What subscription do you have?

Pro ($200)

What platform is your computer?

Darwin 23.4.0 arm64 arm

What issue are you seeing?

I've been noticing flaky commit/open PR/view PR state in the Codex desktop app. Digging into the app server code, I discovered a potential app-server state loss bug that might warrant further attention.

Some live-thread lifecycle paths rebuild Thread from config snapshots and can return thread.gitInfo = null, despite canonical git metadata being available from persisted thread metadata / rollout summaries.

If I'm following right, that means branch / repo identity can be lost during thread reads, forks, and listener reattachment flows. I'm not sure fixing this resolves PR-button weirdness, but that it could remove one of the inputs downstream UI state may depend on.

I validated a small fork patch that preserves thread.gitInfo across those paths without changing API shape.

What steps can reproduce the bug?

I do not have a clean end-user desktop repro for the full PR-button symptom yet, so I am reporting the narrower verified app-server bug here.

Concrete verified reproduction at the code level:

  1. Create or load a thread where git metadata already exists in either:
    • persisted thread metadata, or
    • rollout summary metadata
  2. Exercise a live-thread lifecycle path that rebuilds Thread from snapshot/config state, such as:
    • loaded thread/read
    • thread/fork (materialized or ephemeral)
    • thread listener reattach / watch-manager refresh
  3. Observe that thread.gitInfo can come back as null even though branch/origin metadata already exists for that thread.

I validated this on my fork with targeted regression coverage for:

  • loaded thread/read preserving persisted git metadata
  • materialized thread/fork preserving branch/origin identity
  • ephemeral thread/fork preserving branch/origin identity
  • existing resume coverage for persisted git metadata still passing

What is the expected behavior?

If a thread already has canonical git metadata available, thread.gitInfo should remain stable across live-thread lifecycle transitions.

More specifically:

  • loaded thread/read should not erase branch/origin identity
  • thread/fork should preserve known branch/origin identity
  • listener reattach / live refresh paths should not degrade known git metadata to null

I'm not asserting that desktop should permanently trust stale PR attachment state, but I think shared server responses should not drop already-known branch/repo identity.

Additional information

What I found in the code:

In codex-rs/app-server/src/codex_message_processor.rs, some live-thread flows were using snapshot-built Thread values even though those snapshot builders do not hydrate git metadata.

Affected paths I traced:

  • thread/start
  • loaded thread/read
  • thread listener reattach / watch-manager upsert
  • resumed fork history
  • ephemeral thread/fork

I also found that materialized fork responses might need a small fallback because the newly written fork summary may be blank for git metadata even when the source rollout already has branch/origin info.

I validated a narrow fork patch that:

  • hydrates thread.gitInfo from persisted thread metadata first
  • falls back to rollout-derived summary
  • returns None only when neither source has git metadata

Scope boundaries of the patch:

  • no new RPCs
  • no new Thread fields
  • no protocol/schema changes
  • no PR merge/closure detection
  • no changes to thread/metadata/update semantics
  • no changes to rollout git capture semantics

Fork reference, if useful for inspection:

  • branch: fix/thread-git-info-live-snapshots
  • draft PR: Fuiste/codex#1

Related context:

  • #16186
  • #4043

I'm filing this as a narrow server-side correctness bug that might contribute to desktop PR-state flakiness, I"m not sure it explains or fixes all desktop PR-button behavior.

My fork PR for reference: https://github.com/Fuiste/codex/pull/1

extent analysis

TL;DR

The issue can be fixed by preserving thread.gitInfo across live-thread lifecycle transitions, which can be achieved by hydrating it from persisted thread metadata or rollout-derived summary.

Guidance

  • Verify that the thread.gitInfo is being lost during live-thread lifecycle paths such as thread/read, thread/fork, and listener reattach/refresh by checking the values before and after these operations.
  • Implement a fallback mechanism to hydrate thread.gitInfo from persisted thread metadata or rollout-derived summary when rebuilding Thread from snapshot/config state.
  • Review the code changes in the provided fork patch (fix/thread-git-info-live-snapshots) to understand the proposed solution and consider applying it to the main codebase.
  • Test the changes with the provided regression coverage to ensure that the fix does not introduce new issues.

Example

No code example is provided as the issue does not contain sufficient information to create a minimal code snippet.

Notes

The provided fix is a narrow server-side correctness bug that might contribute to desktop PR-state flakiness, but it is unclear if it resolves all desktop PR-button behavior issues.

Recommendation

Apply the workaround by implementing the fallback mechanism to hydrate thread.gitInfo from persisted thread metadata or rollout-derived summary, as proposed in the fork patch (fix/thread-git-info-live-snapshots). This change is a targeted fix that does not introduce new RPCs, fields, or protocol/schema changes, making it a relatively low-risk solution.

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