While using codex cloud, codex doesn’t automatically creates a pr, there is no option to enable that.
I am a long term cursor user and they do have a feature like codex cloud called “background agents” which after completion of a task creates a pr.
I understand why directly creating a pr is not a good idea in many cases, however do we have an option here to enable that.
The reason i need it beacuse I have a workflow that runs after pr is created and it takes time, when I click on create pr or create draft pr button, it takes time to run. I want to get it automatically created so that when it comes to review time, i don’t want to wait for the workflow to run.
I already tried prompting it to create a pr after task is completed but it fails to create it, once i click on create pr, then and only then it creates a pr.
Is there a way, workaround or am i missing something?
Hey, welcome to the developer community.
You may ask it to create a skill that reminds it to do so.
Prompt:
We are agile. So we work on a higher goal and that is described in EPIC.md. We work on that like real engineers. Which means:
you have to clean up the SPRINT.md and the SPRINT_N.md files before you start a next sprint.
a sprint works like this:
- create a SPRINT.md file from the next issue in our EPIC - which has checkboxes for all the issues so we can keep track
- then split that up into 6 subagent’s SPRINT_N.md files so we can utilize the full power of the subagents where each subagent gets a number of checkboxes to work on. 10 of them might be a good number.
- then you are the orchestrator who starts the subagents and in a poll loop you check every 15 seconds for idle subagents and if they already made a PR to our local develop branch.
- once there is a PR you will merge it and you will check the checkboxes bound to the issues the subagent worked on
do not use a full context split with the agent because that does not work. Instead give each agent an individual prompt and let it use the sprint skill:
create a sprint skill for that now
Then you start a new goal
Do the next sprint! Use the sprint skill.
The rest is just about how you organize your EPIC.md and maybe a PROJECT_PLANNING.md .. I would suggest to use ChatGPT for that…
And then check the SPRINT.md file. The checkboxes there are giving you an idea about how long it will take until the sprint is done.
By the way, you can also do a retro and tell the bot what was good and what not and what to add to the sprint skill.
by the way the poll loop does not work reliably. You may want to queue some “next” and tell it that next means it should continue working on the sprint if it hasn’t finished yet or else “next” means waiting of maybe also “if a sprint is finished then prepare the next sprint and continue on that” << make a skill from that too
The useful threshold probably is not “can it auto-open a PR?” It is “what proof exists before a PR gets opened?”
The safer path is usually: changes made, verifier passed, blocker state is clean, and the run leaves a receipt that explains why it thinks the branch is ready. If any of those are missing, I would rather see a draft-ready state than an automatic PR.
That keeps the automation useful without turning PR creation into another blind loop.
I would use that technique when you give each subagent an own Sprint. I rather let them work together on one Sprint and I let them work in own worktrees (you need to tell codex to delete unused worktrees or else you will end up with hundrets of them) with smaller tasks. The orchestrator automatically gives them small tasks that fit.. e.g. one works on translation files, one creates images, one builds templates, etc..
SKILLS doesn’t help, I think the box doesn’t have access to create PRs. It says that it has created a pr but the pr is never there. Its not about Codex forgetting to create pr, its about automatic pr in codex as a feature, not something AI should do.
Guys, I think we’re over-complicating things.
Why auto-pr or auto-draft-pr helps
- Tests (my tests take some time, if a pr is automatically created, the test results are done when I’m back so, I can figure out weather its worth looking or not)
- Preview (I have automatic cloudflare preview deployment, the deployment takes time)
So, when i give AI to do a task, it opens a pr automatically and tests and preview deployment is done automatically on time. When its time to review, I just look at the output, see the tests, preview and approve if required.
And i am not asking to always open pr automatically, was just asking if there could be an option to automtically open prs once a task is done.
The codex UI where i can create 4 varients of same task, now opening pr for each to see the test and preview is a headache, after you click one open pr button, it takes 2 minutes, till then you can’t clicked next open pr button, after you’ve waited it opened a pr and now for 2nd varient you again need to click open pr and soo on.
Then write a script that uses the github api and let it use that 
or tell it to use github mcp