You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cloud runs: start an incode task on a remote machine and get the result back #23
Claude Code, Codex and Jules can all run a task in the cloud and hand back a branch or PR. incode can only run on the machine you're at. A design first, then a small version.
What incode already has to build on
incode -t "<task>" --output-format json|stream-json: a one-shot, scriptable run with a result object, -p permission mode and -m model.
The GitHub Action (.github/actions/incode, docs/github-action.md): answers @incode on issues and PRs by running incode -t on a GitHub runner and pushing changes to a branch. This is already a cloud run, with GitHub as the cloud.
incode serve: a local run server.
The SDKs (sdk/), which can drive a remote incode over any stdio transport.
sbx: confines a run on the remote machine.
Proposed small version
incode remote run "<task>": dispatches workflow_dispatch on a repo workflow (copy of the action, runs-on: ubuntu-latest) with the task as input. It prints the run URL, waits, and then shows the result object and the branch it pushed.
Needs: a workflow_dispatch entry in .github/workflows/incode.yml.example, a gh-free API call (reqwest + a token from GH_TOKEN), and polling.
incode remote list and incode remote logs <id>.
Secrets: the model key as a repo secret, never in the command line.
Later: a self-hosted target (an SSH host or a container), using incode serve and sbx on the far side.
Questions to settle first
GitHub Actions as the only backend at first? (Free for public repos, no infra.)
One result per run: a branch plus the JSON result, or open a PR automatically?
How long can a run take? (Job timeout, model budget.)
Done in #49 (merged 93762c4): incode remote run | list | logs.
The three open questions, settled:
Backend: GitHub Actions only (workflow_dispatch).
Result: a branch incode/remote-<id> plus the JSON result. No pull request is opened automatically; a person reviews the branch.
Timeout: the client waits 60 minutes by default (--timeout, 1–10080). A wait that runs out cancels nothing, and incode remote logs <run-id> reads the result later. The job itself is capped at 120 minutes.
dispatches the repository's incode-remote.yml with task, model and a fresh id, and finds the run by that id in its title;
checks the run every 10 s (up to 5 failed reads in a row are retried rather than ending the wait);
prints result.json from the run's incode-result artifact: the incode -t --output-format json result plus branch.
It exits non-zero when the run failed, the task reported is_error, or the wait ran out.
incode remote list shows recent runs. incode remote logs <run-id> shows one run's state and result, and exits non-zero for a completed run that failed.
No gh dependency: it uses reqwest. The token comes from GH_TOKEN, else GITHUB_TOKEN.
It travels only in a header, only to the API's own origin, and only over https.
The artifact download's redirect to blob storage is fetched without it.
The workflow ships as a template, .github/workflows/incode-remote.yml.example; setup is in docs/remote-runs.md. It has two jobs:
task runs the agent with contents: read and no stored credentials, then uploads its result and a patch of its changes as data.
publish, on a fresh runner with contents: write, applies the patch and pushes the branch.
Why two jobs: a hosted runner gives the agent's commands sudo, so the job that can push never runs anything the agent left behind.
A patch holding the model key as written is not pushed.
Every input reaches the shell only through environment variables.
Verified:
13 tests against a loopback fake GitHub, with key tests checked by deliberately broken controls.
The workflow's git steps were simulated against a local bare repo (normal case, a patch holding the key, an invalid id).
CI is green on Linux, macOS and Windows.
Not yet verified: a first real run on GitHub Actions. It needs a repository with the workflow copied in and the ANTHROPIC_API_KEY secret set.
Left for later, as this issue planned: a self-hosted target (an SSH host or a container, with incode serve and sbx on the far side).
Activity
remote: find the template's publish job by line, not by "\n" (refs #23)
Merge pull request #49 from incordai/feat/remote-run
blockmandev commentedon Oct 22, 2026
Done in #49 (merged
93762c4):incode remote run | list | logs.The three open questions, settled:
workflow_dispatch).incode/remote-<id>plus the JSON result. No pull request is opened automatically; a person reviews the branch.--timeout, 1–10080). A wait that runs out cancels nothing, andincode remote logs <run-id>reads the result later. The job itself is capped at 120 minutes.How it works:
incode remote run "<task>" [-R owner/repo] [--ref <branch>] [-m <model>] [--timeout <min>] [--no-wait]:incode-remote.ymlwithtask,modeland a freshid, and finds the run by that id in its title;result.jsonfrom the run'sincode-resultartifact: theincode -t --output-format jsonresult plusbranch.is_error, or the wait ran out.incode remote listshows recent runs.incode remote logs <run-id>shows one run's state and result, and exits non-zero for a completed run that failed.ghdependency: it uses reqwest. The token comes fromGH_TOKEN, elseGITHUB_TOKEN.The workflow ships as a template,
.github/workflows/incode-remote.yml.example; setup is indocs/remote-runs.md. It has two jobs:taskruns the agent withcontents: readand no stored credentials, then uploads its result and a patch of its changes as data.publish, on a fresh runner withcontents: write, applies the patch and pushes the branch.Verified:
Not yet verified: a first real run on GitHub Actions. It needs a repository with the workflow copied in and the
ANTHROPIC_API_KEYsecret set.Left for later, as this issue planned: a self-hosted target (an SSH host or a container, with
incode serveand sbx on the far side).