Summary
During a Codex desktop task to create a new PR branch, the agent created a local branch from origin/master and then ran:
git push --set-upstream origin codex/pinch-to-zoom
Because the local branch tracked origin/master, the operation updated the remote default branch instead of creating origin/codex/pinch-to-zoom. The push output made that explicit:
codex/pinch-to-zoom -> master
The agent then had to create and push a revert to restore master.
Expected behavior
When the task is to create a new PR, Codex should not push directly to the repository default branch unless the user explicitly authorizes it. Before a push, it should verify that the remote target differs from the default branch, or use an explicit matching refspec such as:
git push --set-upstream origin HEAD:refs/heads/codex/pinch-to-zoom
Impact
This can make unreviewed changes visible on a shared default branch and requires a follow-up revert. The agent should fail closed or ask for confirmation when a planned branch push resolves to master.
Environment
Codex desktop on macOS, GitHub remote, with a local feature branch initially created from origin/master.
Summary
During a Codex desktop task to create a new PR branch, the agent created a local branch from
origin/masterand then ran:Because the local branch tracked
origin/master, the operation updated the remote default branch instead of creatingorigin/codex/pinch-to-zoom. The push output made that explicit:The agent then had to create and push a revert to restore
master.Expected behavior
When the task is to create a new PR, Codex should not push directly to the repository default branch unless the user explicitly authorizes it. Before a push, it should verify that the remote target differs from the default branch, or use an explicit matching refspec such as:
Impact
This can make unreviewed changes visible on a shared default branch and requires a follow-up revert. The agent should fail closed or ask for confirmation when a planned branch push resolves to
master.Environment
Codex desktop on macOS, GitHub remote, with a local feature branch initially created from
origin/master.