Codex Desktop native GitHub UI does not refresh in the background

Open 💬 5 comments Opened Jun 30, 2026 by coryparrry

Summary

Codex Desktop's native GitHub / PR UI appears to fetch on startup, reset, or route mount, but it does not keep GitHub state refreshed while Codex is in the background.

This makes the native GitHub surface stale during normal multi-window workflows where Codex is open but not focused.

Environment

  • Codex Desktop: 26.623.70822
  • Build: 4559
  • App/server CLI version observed in local thread metadata: 0.142.4
  • macOS: arm64 desktop
  • Installed app path inspected: /Applications/Codex.app

Expected behavior

Native GitHub state should continue refreshing in the background, including:

  • PR board data
  • PR body
  • PR comments
  • PR checks
  • thread/repo Git metadata where applicable

The user should not need to reset, reload, or reopen the native GitHub UI to see current state.

Actual behavior

The native GitHub UI refreshes on startup/reset/mount, but then stale data remains visible while Codex is open in the background. Returning to the app or resetting/remounting can make it sample fresh state again.

Local Git itself is correct. The stale state appears to be Codex's cached/thread/UI metadata, not the repository.

Investigation notes

I inspected the installed Codex app bundle and local read-only state. The likely issue is that native GitHub refresh is implemented as renderer-page polling rather than a durable app-level background refresh.

Evidence from the bundled app:

  • The PR board uses gh-pr-board with intervalMs: THIRTY_SECONDS and staleTime: THIRTY_SECONDS.
  • PR detail queries such as gh-pr-comments, gh-pr-body, and gh-pr-checks use interval polling as well.
  • The shared query runtime maps intervalMs to React Query refetchInterval.
  • The React Query polling path is focus-gated unless refetchIntervalInBackground is set.
  • The gh-pr-* query configs I inspected did not set refetchIntervalInBackground.
  • Codex also has local Git watcher invalidations for git/* query keys such as status-summary and branch-diff-stats, but I did not find those watcher invalidations wired to gh-pr-board, gh-pr-comments, gh-pr-body, or gh-pr-checks.

So the current design appears to depend on focus/visibility-sensitive renderer polling, while the expected behavior is background refresh independent of whether the PR page is foregrounded.

Why this is likely not local Git corruption

Live Git commands report the current branch and HEAD correctly. Separately, older Codex thread rows can retain old git_sha values after the repo has moved forward, while newer thread rows sample the current SHA. That suggests stale Codex metadata/UI cache rather than a broken local repository.

Suggested fix direction

Short-term:

  • Set refetchIntervalInBackground: true on the native GitHub PR query configs where background refresh is expected.
  • Ensure the main renderer/webContents is not throttling the required refresh loop if the refresh remains renderer-owned.

Longer-term:

  • Move GitHub refresh into the Codex app-server/main-process lifecycle and push/invalidate renderer state from there, so refresh does not depend on a mounted/focused renderer page.
  • Add invalidation/update coverage for thread Git metadata when repo HEAD changes.

Validation that would confirm

Open the Codex native PR board, observe gh-pr-board / related gh-pr-* requests while foregrounded and then while Codex is backgrounded for more than 60 seconds. If requests stop until reset/remount/focus, that confirms the focus/background polling issue.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗