MoltenHub Code is a Go harness that turns agent prompts into repository changes across one or more GitHub repositories.
It supports three execution modes:
- Single run (
run) - Parallel local runs (
multiplex) - Persistent Hub listener with local UI (
hub)
Build:
go build -o bin/harness ./cmd/harnessSingle run:
./bin/harness run --config ./run.example.jsonParallel local runs:
./bin/harness multiplex --config ./tasks --parallel 4Hub listener:
./bin/harness hubPer run, the harness:
- Verifies required tooling and auth (
git,gh, selected agent CLI). - Creates an isolated workspace.
- Clones target repo(s) and checks out
baseBranch. - Runs the configured agent in
targetSubdir(or workspace root for multi-repo runs). - Opens or updates PRs for changed repos.
- Waits for required checks.
Branch/PR rules:
- Create a new branch only when starting from
main. - Reuse the existing non-
mainbranch when already on one. - Branch names and PR titles start with
moltenhub-.
When a task fails, the runtime:
- Returns a failure response to the calling agent that clearly marks failure and includes error details.
- Queues a focused follow-up remediation task in the MoltenHub code repository (when the failure is remediable).
- Passes relevant failing log path context into that follow-up prompt.
Failure follow-up run config shape:
{"repos":["git@github.com:Molten-Bot/moltenhub-code.git"],"baseBranch":"main","targetSubdir":".","prompt":"Review the failing log paths first, identify every root cause behind the failed task, fix the underlying issues in this repository, validate locally where possible, and summarize the verified results."}Follow-up contract includes:
Issue an offline to moltenbot hub -> review na.hub.molten.bot.openapi.yaml for integration behaviours.
Required fields:
- One of
promptorlibraryTaskName - One of
repo,repoUrl, orrepos
Common optional fields:
baseBranch(defaultmain)branch(alias forbaseBranch)targetSubdir(default.)agentHarness(codex,claude,auggie,pi)agentCommandcommitMessageprTitleprBodylabelsreviewers
Use camelCase keys only.
Example: run.example.json
Key fields:
base_url(defaulthttps://na.hub.molten.bot/v1)bind_tokenoragent_token(first-time activation)session_key(defaultmain)handleprofile.display_name,profile.emoji,profile.profileagent_harness,agent_commanddispatcher.*- Optional bootstrap secrets:
github_token,openai_api_key,augment_session_auth
Runtime persists auth/config to ./.moltenhub/config.json (default layout).
Example: init.example.json
Supported harness packages:
codex:@openai/codex@latestclaude:@anthropic-ai/claude-code@latestauggie:@augmentcode/auggie@latestpi:@mariozechner/pi-coding-agent@latest
Live spec:
https://na.hub.molten.bot/openapi.yaml
Offline runtime integration snapshot in this repo:
Build:
docker build -t moltenhub-code:latest .Run hub mode (default UI on :7777):
docker run --rm -p 7777:7777 moltenai/moltenhub-code:latest-codexPi variant:
docker run --rm -p 7777:7777 moltenai/moltenhub-code:latest-pi
For persistent local runtime config, mount `./.moltenhub` to `/workspace/config`.
## Test
```bash
go test ./...