Coding Agent Task Runner - Codex & OpenCode, Patch Out
Pricing
from $20.00 / 1,000 task starts
Coding Agent Task Runner - Codex & OpenCode, Patch Out
Give a repository and a task, get a patch, changed files, test results and the agent's summary in one call. Codex CLI or OpenCode, models through Apify's OpenRouter proxy, no API key of your own.
Pricing
from $20.00 / 1,000 task starts
Rating
0.0
(0)
Developer
Vadim Bezrukov
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
12 days ago
Last modified
Categories
Features
Share
Give it a Git repository and a task in plain words. The Actor clones the repository, runs a coding agent (OpenAI's Codex CLI or OpenCode) headless with a deadline, and returns:
patch.diff: a binary-safegit diffyou can apply withgit apply- the changed files, insertions and deletions
- the result of your test command (
npm test,pytest -q, ...) if you give one - the agent's own summary, its log and a status you can branch on
One call: task in, patch out. Models run through Apify's OpenRouter proxy, so you need no OpenAI, Anthropic or OpenRouter key of your own.
Try the prefill. It asks the agent to add a CONTRIBUTING.md to octocat/Hello-World.
On our test runs Codex CLI with deepseek/deepseek-v4-flash finished in 7 to 14 seconds
with 4 to 8 model requests and about $0.003 of tokens, and returned a two-file patch (new
CONTRIBUTING.md, a link in the README). The whole run took 20 to 30 seconds and its Actor
events come to $0.06.
Use it from n8n, Make or your own code
An agent run often takes longer than the 300 seconds a synchronous API call waits, so start the run asynchronously and wait for it:
- Trigger: for example a GitHub issue that gets the label
agent. - Start the run: Apify node "Run an Actor" (or ) withPOST https://api.apify.com/v2/acts/automa-flow~coding-agent-task-runner/runs?maxTotalChargeUsd=1.{"repoUrl": "https://github.com/you/repo", "task": "<issue title and body>", "testCommand": "npm test"}
- Wait: Apify node "Wait for run to finish", or poll
GET /v2/actor-runs/{runId}every 30 seconds until the run is no longerRUNNING. - Branch on the row: read the one Dataset item;
statusisDONE,NO_CHANGES,TIMEOUT, ... andtestsPassedtells you whether your tests passed. - Use the patch: fetch
patch.difffrom the run's Key-Value Store (). Post it as an issue comment for review, or send it to a GitHub Actions workflow (GET /v2/key-value-stores/{defaultKeyValueStoreId}/records/patch.diffrepository_dispatch) that runsgit applyandgh pr create.
The Actor never pushes to your repository and never opens pull requests: you decide what happens with the patch.
Pricing
Pay per event, Apify platform usage included:
| Event | Price | When |
|---|---|---|
| Actor start | $0.0003 per GB of memory | each run (2 GB default: $0.0006) |
| Task start | $0.02 | once, when the agent starts and the model answers |
| Agent minute | $0.04 | each started minute of agent plus test time, 2 GB included |
| Extra GB-minute | $0.01 | each started GB-minute above 2 GB (4 GB adds $0.02 a minute) |
Nothing past the start event is charged when the input is invalid, the clone fails, the model is refused, the proxy is down or the budget cannot cover one minute. Retries and time after the deadline are never charged.
Model tokens are billed separately by Apify's OpenRouter proxy, on your Apify account at
the provider's price. The row shows tokenCostUsd as the proxy reported it. Your
maxTotalChargeUsd limits this Actor's events, not tokens: maxModelRequests is what bounds
your token bill.
Example bills at 2 GB:
- the prefill (1 minute): $0.06 plus about $0.003 of tokens
- a 10-minute task: $0.42 plus tokens (cheap models: cents; frontier models: dollars)
- 100 such tasks a month: about $42 plus tokens
A small maxTotalChargeUsd shortens the agent's deadline to the minutes it covers, and the
run says so in RUN_SUMMARY. One minute with its start events costs $0.061 at 2 GB, $0.082 at
4 GB and $0.123 at 8 GB; a lower cap ends in BUDGET_EXCEEDED before any work.
Input
| Field | What it does |
|---|---|
repoUrl | https:// clone URL. SSH, git@, file: and URLs with a token inside are refused. |
task | What to change, 10-8,000 characters, for example an issue body. |
agent | codex (default) or opencode. With the default model Codex is the more reliable: in our tests OpenCode stopped early without changes in 3 of 9 runs (NO_CHANGES, charged). |
model | OpenRouter model ID, default deepseek/deepseek-v4-flash. |
gitRef | Branch, tag or 40-character commit SHA. Default: the default branch. |
gitToken | Read token for a private repository. Used for the clone only. |
testCommand | Shell command run with bash -lc after the agent, up to 500 characters. |
testTimeoutSeconds | 10-1,800, default 300. Counts toward agent minutes. |
maxMinutes | Agent deadline, 1-60, default 10. |
maxModelRequests | Model calls allowed, 1-2,000, default 200. |
includeUntracked | Include new files in the patch (default on). |
failRunOnError | End the run FAILED when the status is not DONE or NO_CHANGES. |
secrets | Environment variables for the agent and the tests, for example a registry token. |
Output
One Dataset row per run (views: Overview and Details). Abridged, from a test run of the prefill:
{"status": "DONE","message": "The agent changed 2 files.","repoUrl": "https://github.com/octocat/Hello-World","gitRef": "master","baseCommit": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d","agent": "codex","agentVersion": "codex-cli 0.167.0","model": "deepseek/deepseek-v4-flash","filesChanged": 2,"insertions": 9,"deletions": 0,"changedFiles": ["CONTRIBUTING.md", "README"],"skippedLargeFiles": [],"patchKey": "patch.diff","patchBytes": 895,"testCommand": null,"testsPassed": null,"agentSummary": "Created CONTRIBUTING.md with three bullet points and added a link to it at the bottom of the README.","agentMinutes": 1,"modelRequests": 8,"promptTokens": 75028,"completionTokens": 990,"tokenCostUsd": 0.002634,"fingerprint": "67104d66b493041387daacba4f8a221e2c90148c0e88aa16d805ec3c487148cb"}
The Key-Value Store holds patch.diff, agent-log.txt and test-log.txt (redacted, at
most 1 MiB each), RUN_SUMMARY (the row plus phases, durations, model request counts,
charged events and CLI versions) and BILLING_RECEIPT.
Statuses
| Status | Meaning | Charged |
|---|---|---|
DONE | The patch is not empty. Failing tests still give DONE with testsPassed: false. | yes |
NO_CHANGES | The agent finished without changing files. | yes |
AGENT_FAILED | The agent exited with an error and changed nothing, or got no model answer in 5 minutes and was stopped. | if the model answered |
TIMEOUT | The deadline was reached; the patch so far is returned. | yes |
REQUEST_LIMIT | maxModelRequests was used up; the patch so far is returned. | yes |
MODEL_UNAVAILABLE | The proxy refuses the model. | no |
PROXY_FAILED | The model proxy did not answer. | no |
REPO_NOT_FOUND | Wrong URL or ref, or a private repository without a token. | no |
REPO_AUTH_FAILED | The git host refused the token. | no |
REPO_TOO_LARGE | Over 500 MiB or 50,000 files after the clone. | no |
REPO_UNAVAILABLE | The git host did not answer after 3 attempts. | no |
INPUT_INVALID | An input field is wrong; the run fails. | no |
BUDGET_EXCEEDED | maxTotalChargeUsd cannot cover one agent minute; the run fails. | no |
Every other status writes the row and ends the run normally, so a pipeline can branch on
status. Turn on failRunOnError if you want a failed run instead.
Security model and privacy
The agent approves every command it decides to run, and a task or repository can come from someone you do not trust. The Actor protects what matters to you:
- The agent and the test command run as an unprivileged user with an environment built
from scratch: no Apify token, no proxy password, no
gitToken, noAPIFY_*variable. - Model calls go through a local forwarder that adds your Apify token itself, allows only
the model endpoints and stops at
maxModelRequestsand at the deadline. The model provider comes from the run: anopencode.jsonor.codex/config.tomlin the repository cannot point the agent elsewhere. gitTokenis used for the clone only and is never written to.git/config.- Every secret value is removed from logs, the row and the KVS files, also in its URL and base64 forms. The task text is never logged (only its length and hash).
- At the deadline the agent's whole process group is stopped and every leftover process of the sandbox user is killed.
This is a container, not a virtual machine. Outbound network stays open, so the agent and
your tests can install packages. Put only the secrets your tests need into secrets.
Privacy: the repository content and the task are sent to the chosen model provider through OpenRouter. Do not run it on code you may not share with that provider.
Limits
- One repository and one task per run; agent deadline up to 60 minutes.
- Repository up to 500 MiB and 50,000 files after a shallow clone.
- Files over 5 MiB are left out of
patch.diffand listed inskippedLargeFiles; a patch over 8 MiB is not stored. - The image has git, ripgrep, Node.js 22 and Python 3.12. Other toolchains can be installed by the test command or the agent at run time.
- Memory 2-8 GB (default 2 GB). Bigger builds need more memory, which adds extra GB-minutes.
- No pushing, no pull requests, no interactive sessions.
Use it from an AI agent (MCP)
Add the Actor as a tool through Apify's MCP server:
https://mcp.apify.com?tools=automa-flow/coding-agent-task-runner. An assistant can then
hand a coding task to a separate agent, wait for the run and read status, changedFiles,
testsPassed and patch.diff before it decides what to do next. Set maxModelRequests and
maxTotalChargeUsd in the call to bound the bill.
If a run fails or looks wrong, open an Issue and include the run URL. Release notes are in the changelog.


