Repository navigation
Description
What issue are you seeing?
New Codex Cloud tasks using an existing published Cloud environment repeatedly start from an outdated Git commit, even after the repository's default main branch has advanced and the new commit is visible through the GitHub API.
This is about the actual checked-out HEAD, not merely a stale diff counter or remote-tracking comparison.
Observed on 2026-11-15 (JST) in the Codex Cloud experience accessed from Windows desktop / ChatGPT web. The affected GitHub repository is private; repository/account identifiers, exact commit hashes, environment IDs, and task URLs are intentionally omitted from this public report.
- A pull request was successfully merged into GitHub
main(one existingAGENTS.mdfile changed, 40 additions, 0 deletions). - Independent GitHub API checks confirmed that live
mainhad advanced from commit A to commit B. - Multiple new, separate Cloud tasks launched with the same published repository environment continued to show
HEAD=Aon the Cloud task'sworkbranch, withgit statusclean. - In an affected task, only
refs/heads/workwas found in the local refs listing; a normal localmain/ remote-tracking ref was not present in that task. - Read-only inspection consistently reproduced the stale checkout. No local edits or uncommitted changes caused the mismatch.
- Explicitly fetching the latest remote
mainand fast-forwarding the individual task workspace succeeded, producingHEAD=Band showing the expected 40-line update. - Yet another brand-new task from the same published Cloud environment again started at
HEAD=A. Updating a task does not update the baseline for subsequent tasks.
The environment was already published and linked to the correct repository. The repository's GitHub default branch is main; no GitHub main-side failure was observed.
What steps can reproduce the bug?
- Connect a private GitHub repository with a
mainbranch to a published Codex Cloud environment. - Note an existing Cloud task's
HEAD=A. - Merge a small change into GitHub
main, yieldingB(where A is an ancestor of B). - Independently verify that GitHub's live
mainpoints to B. - Create a new Cloud task explicitly choosing the already-published environment. Run read-only:
Actual:
git rev-parse HEAD git branch --show-current git status --porcelain=v1 git show-ref
HEAD=A, branchwork, clean tree; no updated main remote-tracking reference. - In that task only, after confirming clean state and ancestor relationship, explicitly run:
Result: the fetch/fast-forward succeeds and local task
git fetch --no-tags origin refs/heads/main git rev-parse FETCH_HEAD git merge --ff-only FETCH_HEAD git rev-parse HEAD
HEAD=B. - Create another separate Cloud task with the same environment and inspect
HEADbefore any fetch. Actual: it starts again at A.
The above mismatch was reproduced on more than one newly created task. Running Git operations within one task was not found to persist updates to subsequent tasks.
What is the expected behavior?
A newly created Cloud task for a repository-backed environment should use a current, appropriately selected base revision from the requested GitHub branch (or clearly disclose the cached revision and offer a supported refresh / rebase mechanism). At minimum, users should not unknowingly begin development against an old commit when the selected repository's main has already advanced.
Additional information
- Cloud environment / repository binding, default branch, and GitHub API current
mainwere checked independently. - The published environment's setup and repository refresh behavior could not be inspected sufficiently to determine the root cause. A stale prepared snapshot, delayed background refresh, or task checkout ref selection are hypotheses, not confirmed causes.
- A separate issue involving submodule setup was observed in the same environment; that is not necessary to reproduce the stale-HEAD mismatch and should not be conflated with it.
- The safe per-task workaround is a checked
git fetchplusgit merge --ff-only FETCH_HEADon a clean task. This does not fix newly created tasks. - Related but not identical: Codex Desktop remote diff counter stays stale until manual git fetch updates origin/main #31534 (stale remote diff counter rather than actual HEAD), Codex environment lacks proper git refs, causing large PRs with unchanged files #9952 (missing tracking refs in Cloud), [Codex Cloud] Published environment not applied to new Cloud tasks #50815 (published environment not applied).
- No private code, credentials, account identifiers, or private repository links are included here. A private support channel would be needed to provide exact environment/task IDs.
Activity