Codex: Automatically push to branch instead of creating a PR

Pull requests can be a bit cumbersome: once created, they remain and clutter the GitHub metadata indefinitely. It would be more convenient to alternatively specify a target branch to which Codex should push the results — even without confirmation.

On the client side, we can then simply poll the branch at regular intervals using, for example, git ls-remote --heads origin refs/heads/codex-ca0e73be.

Bonus: allow specifying this branch as a URL query parameter when invoking Codex, for example:

https://chatgpt.com/codex?targetBranch=codex-ca0e73be

With a combination of these features, we can streamline the overall workflow, allowing our local Git clients to:

  • initiate the job
  • poll for and pick up Codex results
  • review them
  • have Codex refine them
  • or finally merge the results.

Codex rocks!