OpenCode
OpenCode is a self-hosted AI coding agent. You run the OpenCode server on your own infrastructure; beeps connects to it over HTTP, creates a session per alert, and sends a prompt. OpenCode produces a file diff (it does not open a PR by itself).
Prerequisites
Section titled “Prerequisites”- A running OpenCode server reachable from beeps. See the OpenCode server docs for installation.
- HTTP Basic auth credentials for the server.
- The server’s URL.
Provider-side setup
Section titled “Provider-side setup”- Install and run OpenCode following opencode.ai/docs/server.
- Configure HTTP Basic auth on your server. The password becomes
apiKeyin beeps; the username goes in metadata (defaultopencode). - Note the server URL. You’ll pass it on the relay rule as
endpoint.
Beeps-side setup
Section titled “Beeps-side setup”Create the integration with the basic-auth password as apiKey:
const openCodeIntegration = await client.integration.create({ name: "OpenCode - internal", provider: "opencode", apiKey: process.env.OPENCODE_SERVER_PASSWORD, metadata: { username: "opencode", },});Reference it from a relay rule. OpenCode needs an endpoint pointing at your server. The optional openCodeModel lets you pick which model the session runs:
await client.relay.rules.create(relayId, { name: "OpenCode investigation", ruleType: "agent", config: { agentType: "opencode", integrationId: openCodeIntegration.id, endpoint: "https://opencode.internal.corp:4096", openCodeModel: { providerID: "anthropic", modelID: "claude-sonnet-4-20250514", }, pollInterval: 15000, maxPollAttempts: 200, },});Configuration reference
Section titled “Configuration reference”Integration metadata
Section titled “Integration metadata”| Field | Type | Required | Default | Description |
|---|---|---|---|---|
username | string | no | opencode | HTTP Basic auth username |
Rule config
Section titled “Rule config”| Field | Type | Required | Default | Description |
|---|---|---|---|---|
agentType | "opencode" | yes | — | Selects the OpenCode agent |
integrationId | string | yes | — | The OpenCode integration’s id |
endpoint | string (URL) | yes | — | Base URL of the OpenCode server |
openCodeModel.providerID | string | no | server default | Provider id, e.g. anthropic |
openCodeModel.modelID | string | no | server default | Model id, e.g. claude-sonnet-4-20250514 |
The shared polling and storm-control fields are documented in Relay Rules.
Troubleshooting
Section titled “Troubleshooting”401 Unauthorized on session creation. Beeps sends Authorization: Basic <base64(username:apiKey)>. Confirm both the username (in metadata) and password (apiKey) match the server’s basic-auth config.
Session completes but no PR is created. OpenCode produces a file diff, not a PR. Check the session’s diff endpoint on your server, or wire your own commit/PR step downstream.