Pasting a GitHub repository URL into a conversation incorrectly assumes the main branch
What issue are you seeing?
When a GitHub repository URL is pasted directly into a Codex conversation, the cloud environment appears to assume that the repository has a branch named main.
For example, mysql/mysql-server uses trunk as its default branch and does not have a main branch. Referencing that repository in a prompt causes the cloud task to fail before Codex can inspect the repository:
Provided git ref main does not exist
This prevents Codex from working with GitHub repositories whose default branch is named something other than main.
What steps can reproduce the bug?
- Start a Codex conversation that runs in a cloud environment.
- Paste
https://github.com/mysql/mysql-serverinto the conversation and ask Codex to inspect or work with the repository. - Submit the prompt.
- Observe that the cloud environment attempts to resolve or check out
main. - The task fails with
Provided git ref main does not exist.
What is the expected behavior?
Codex should resolve and use the repository's actual default branch from GitHub metadata—in this case, trunk—unless the URL or prompt explicitly specifies another branch or ref. It should not hardcode main.
Additional information
This may be related to #9111, which reports the same hardcoded-main failure when submitting cloud tasks from the CLI. This report covers a different entry path: pasting an external GitHub repository URL directly into the conversation.