Bootstrap OpenCode on new boxes against OpenRouter #99

Closed AtlantisPleb opened this 20h ago 1 comment

Each box in the Ox Alpha stress fleet runs the OpenCode agent harness against the OpenRouter API, so the fleet burns Ox Alpha tokens through the account key the app already holds.

When box_new (#98) brings a box to ready:

  1. Install OpenCode with the published installer (curl -fsSL https://opencode.ai/install | bash).
  2. Deliver the OpenRouter API key from the app's OPENROUTER_API_KEY runtime configuration to the box through the Box file-write endpoint, not through a command argument, so the key never appears in command logs or event streams.
  3. Configure the default model from the app's openrouter_model configuration (currently stealth/ox-alpha), so opencode run "..." targets Ox Alpha without per-call flags.
  4. Record bootstrap success or failure on the box ledger row; box_list shows it.

The agent then drives OpenCode through box_exec (for example opencode run "fix the failing test"), and can parallelize across up to 10 boxes per conversation.

Central OpenCode auth versus the OpenRouter key was left open; start with the OpenRouter key because the app already holds it and OpenCode reads it natively.

  1. AtlantisPleb opened this issue 20h ago
  2. A AtlantisPleb Author 20h ago

    Done in commit 40415a0 on main: every new box runs a setup script that installs OpenCode and writes opencode.json pointing at the configured OpenRouter model; the OpenRouter key travels only through the box environment, and setup status (pending/running/done/failed) is tracked on the conversation box record and surfaced by box_new and box_list.

  3. closed this as completed 20h ago
Sign in with GitHub to comment on this issue.