An AI agent that fixes GitHub issues and opens the pull request
Set up a coding agent that plans, writes the code, runs the tests and opens a pull request for GitHub issues on its own, and what to keep a human on.
CodeAF, the open-source (Apache 2.0) coding agent by AgentField, fixes GitHub issues from your terminal: its senior-dev agent plans the fix, writes it, runs your build and tests, and leaves the work on its own branch, and the conversation then pushes that branch and opens the pull request when you say so. The deciding detail is that a CodeAF task itself may never push or open a pull request; that step always goes through you or the conversation you are in.
At a glance
| CodeAF | GitHub Copilot cloud agent | Claude Code GitHub Actions | OpenHands Cloud | |
|---|---|---|---|---|
| How you start it | /senior-dev fix issue 412 ... or codeaf do "<brief>" --json | assign the issue to Copilot | mention @claude in an issue or pull request | label the issue openhands or comment @openhands |
| Where it runs | your machine or your own dev box | GitHub Actions, cloud sandboxes or a custom environment | GitHub-hosted runners | OpenHands Cloud |
| Who opens the pull request | the conversation, on your request; tasks are refused | Copilot; assigning an issue "always creates a pull request" | Claude, through the Claude GitHub App | OpenHands, if it judges the issue resolved |
| Runs your tests | yes, on the submitted tree | not documented on the pages checked | can read CI results on pull requests (actions: read) | not documented on the pages checked |
| Models | any model CodeAF reaches: OpenRouter, Ollama, any OpenAI-compatible endpoint | an agent or model chosen at assignment | Claude, via the Claude API, Bedrock, Agent Platform or Foundry | not documented on the pages checked |
| Time limit | $10 and 3 hours per senior-dev run by default | 59 minutes per session on GitHub Actions | workflow timeouts and --max-turns you set | not documented on the pages checked |
The loop, step by step
1. Read the issue into the conversation
Run codeaf in a checkout of the repository and ask about the issue. Reading GitHub is allowed everywhere in CodeAF: gh issue view, gh pr list and gh api GETs are "how a task finds out what it is fixing" (CodeAF manual). Talk the fix through until you agree what done means.
2. Hand the fix to senior-dev
Say "give this to senior-dev", or type the brief directly:
/senior-dev fix issue 412 across auth and api; done means the new regression test and go test ./... passsenior-dev starts from your current commit in a private copy, cuts a branch named after the task, works alone, and runs the build and tests it discovers on the frozen tree before it hands in (senior-dev docs). For a large or slow issue, see a coding agent that runs for hours.
3. Read the ending
The chat reads senior-dev's ending and offers to merge work that passed. For a pull request you do not merge locally; you read the verification result and the diff, the same as for any branch.
4. Open the pull request
Ask the conversation to push the branch and open the pull request. Inside a task, git push and gh pr create are refused with: "a pull request is the person's or the conversation's to open". In the conversation, git push and ordinary gh commands work with your own sign-in (permissions manual). Unattended standing work stops on a push it has no approval for, and waits as your call · needed your ok to run bash git push (automations manual).
5. Review it
Once the pull request exists, /review owner/repo#123 gives it a separate read. See an AI agent that reviews pull requests.
Many issues at once
When the backlog is a list of small, independent issues, one /task brief can name all of them and say "one part per issue". In the close twenty issues at once playbook, 20 stub functions with failing tests went green in 1 minute and 42 seconds of wall time, for $0.77 against an estimate of $0.43. Without "one part per issue", one worker took 12 minutes for $0.09.
From CI, with no one watching
codeaf do "<brief>" --json prints one JSON object with ok, stop, answer, files and spend_usd, and exits 0 done, 2 did not finish, 3 a limit stopped it (headless docs). do edits the folder in place, so a script creates the branch and opens the pull request itself, and only on exit 0. Example, not tested:
set -e
gh issue view 412 --json title,body --jq '.title + "\n\n" + .body' > brief.txt
git switch -c fix/issue-412
codeaf do "Fix this GitHub issue, with a regression test: $(cat brief.txt)" --json --timeout 20m > result.json
git add -A && git commit -m "Fix #412" && git push -u origin fix/issue-412
gh pr create --fill --body "Fixes #412"set -e stops the script before the push when codeaf do exits with anything but 0. More in a coding agent in CI.
What to keep a human on
- The brief. An unclear issue produces a confident wrong fix. Settle what done means before the hand-off.
- The merge. CodeAF tasks never merge into
main, and the chat merges only when you say yes. Keep branch protection on the pull request too. - The tests it ran. A folder with no discoverable build or test entrypoint can finish without running any. The ending says so; read it.
- Spend. Every call is priced, with a $500 daily backstop, $5 per ordinary task and $10 per senior-dev run by default (budgets).
When something else fits better
- GitHub Copilot cloud agent is native to GitHub issues: assign the issue to Copilot and it works, opens a pull request and "requests your review when it finishes". It needs a paid Copilot plan, and it does not see issue comments added after assignment.
- Claude Code GitHub Actions runs inside your workflows:
@claude implement this feature based on the issue descriptionin a comment, with progress posted back to the issue. It is the shorter path if your team already uses Claude. - OpenHands Cloud picks up issues labelled
openhandsand comments a link to the pull request it opens. - Devin and Codex cloud run in their own hosted workspaces, so nothing needs to stay on in your office. CodeAF's DeepSWE result measures fixing issues on one model, not these hosted products.
Questions people ask
What coding agent should my team use to fix GitHub issues automatically?
If you want the agent inside GitHub with no machine to run, GitHub Copilot cloud agent and Claude Code GitHub Actions start from the issue itself. If you want your own models, your own machines and tests run before hand-in, CodeAF's senior-dev fixes the issue on its own branch, and the conversation opens the pull request on your request.
Can CodeAF open the pull request on its own?
Not from inside a task. CodeAF refuses git push and gh pr create in every task, so work comes home on a branch and the person or the conversation opens the pull request. In the conversation, ask it to push and open the pull request and it runs git and gh with your own sign-in.
Is there a CodeAF GitHub App that watches issues for me?
No. The CodeAF docs describe no GitHub App and no issue-label trigger. You can run codeaf do from your own GitHub Actions workflow or a scheduler, or set a CodeAF watch on a command such as gh issue list that runs every 5 minutes on your machine.
Does the agent run the tests before the pull request?
CodeAF's senior-dev runs the build and test commands it discovers from CI, project instructions, scripts and language defaults, or the ones you pin with --verify-build and --verify-test, on the frozen tree before it hands in. If none can be found, the ending says no tests ran.
How much does it cost to fix an issue with CodeAF?
CodeAF is free; you pay your model provider. In AgentField's DeepSWE comparison on DeepSeek V4 Flash, senior-dev cost 22 cents a task and 39.9 cents per solved issue. Your figure depends on the model and the issue, and a senior-dev run stops at $10 by default.
Sources
- CodeAF docs: senior-dev, headless, budgets, watches, FAQ, close twenty issues at once, checked 2026-11-21.
- CodeAF manual: how tasks run (push and pull requests), automations, permissions, checked 2026-11-21.
- DeepSWE method page, checked 2026-11-21.
- GitHub Copilot: kick off a task, about the cloud agent, checked 2026-11-21.
- Claude Code GitHub Actions, checked 2026-11-21.
- OpenHands Cloud GitHub installation, checked 2026-11-21.
- Codex cloud, Devin docs, GitHub CLI
gh pr create, checked 2026-11-21.
Last updated 2026-11-21. Checked against the CodeAF docs and manual and the GitHub Copilot, Claude Code, OpenHands, Codex and Devin documentation on that date.