incode remote run "<task>" runs the task with incode -t on GitHub Actions
instead of on your machine, waits for it, and prints its result. The run
pushes whatever the agent changed to a branch incode/remote-<id>; it opens
no pull request.
incode remote run "fix the flaky test in tests/net.rs"
incode remote run "update the changelog" -R incordai/incode --ref release -m "$MODEL_ID"
incode remote run "bump the MSRV to 1.85" --no-wait # print the run's address and return
incode remote list # recent runs: id, state, title, address
incode remote logs 1234567890 # one run's state, address and resultincode remote runmakes an id and dispatches the repository's.github/workflows/incode-remote.yml(workflow_dispatch) with the inputstask,model(when-mis given) andid, on--refor the repository's default branch.- It finds the run that started by its title,
incode remote <id>, and prints its address (on stderr). - It polls the run every 10 seconds until it completes, for up to
--timeoutminutes (60 by default). If the wait runs out it says the run is still going, prints its address and exits non-zero; the run is not cancelled, andincode remote logs <run-id>reads its result later. - It downloads the run's
incode-resultartifact and prints itsresult.jsonon stdout: the objectincode -t --output-format jsonprints, plusbranch—incode/remote-<id>when the agent changed something, elsenull.
It exits non-zero when the run did not succeed or the result says
"is_error": true.
-
The workflow. Copy
.github/workflows/incode-remote.yml.exampleto.github/workflows/incode-remote.ymlin your repository and commit it to the default branch (GitHub dispatches a workflow only once it knows it), and to any branch you will pass as--ref. -
The model key. Add the API key as a repository secret,
ANTHROPIC_API_KEY. For another provider, change the workflow's "Configure the model" step (KEY_ENV,API_URL,API_FORMAT— the same fields as the GitHub Action's inputs). -
The model. Set a repository variable
INCODE_MODELto the model id, or pass-mon each run. -
Your token.
incode remotereads a GitHub token fromGH_TOKEN, elseGITHUB_TOKEN. It needs Actions: read and write on the repository (a fine-grained token), or therepoandworkflowscopes (a classic one). With the GitHub CLI signed in:GH_TOKEN=$(gh auth token) incode remote run "..."
The repository is -R owner/name, else the github.com repository your
origin remote names (https or ssh). GitHub Enterprise servers are not
supported.
run-name: incode remote <id>; then two jobs on ubuntu-latest.
task — with contents: read only:
- checks the id is letters, digits and dashes (it names the branch);
- checks out the repository without keeping a token in it
(
persist-credentials: false) and installs the latest incode release withscripts/install.sh, as the GitHub Action does; - writes a one-route
admin.json(the key's variable name only) into a privateINCODE_DIR; - runs
incode -t "$TASK" --spec-gate off --output-format json, writingresult.jsonoutside the checkout; - records everything the agent changed as a patch against the starting
commit and uploads it with
result.jsonas the artifactincode-work.
publish — with contents: write, on a fresh runner:
- applies the patch, commits it to
incode/remote-<id>and pushes that branch, when there is one; - adds
branchtoresult.jsonand uploads it as the artifactincode-result; - fails the run when the task failed.
The split is deliberate: the agent runs commands, and a hosted runner gives them sudo, so nothing later in its own job can be trusted to be as the workflow wrote it. The job that can push never runs anything the agent left behind; it only applies a patch.
- Who can run it. Dispatching a workflow takes write access to the
repository. The agent's job holds your model key but no token that can
push; only the
publishjob can, and it runs none of the agent's code. - The model key stays off the branch.
publishrefuses to push changes that hold the key as written. That catches an agent that writes its environment into a file; it cannot catch one that encodes the key first, so the key should be one you can revoke, scoped to this use. - The task is untrusted text. The workflow passes it, and every other input, through environment variables; none is spliced into a script.
- No pull request, no existing branch. The run pushes only a new
incode/remote-<id>branch; a person reviews it and opens the pull request. A push made with the workflow'sGITHUB_TOKENstarts no other workflow. - Your token stays with GitHub.
incode remotesends it only toapi.github.comover https, in a header. The artifact download is redirected to GitHub's storage; that request is made without the token. The token is never printed or put in an address.