Skip to content
stage

OpenCode

Stage runs tasks as sessions on an existing OpenCode V2 service, over its HTTP API. OpenCode keeps what it owns: projects, workspace strategy, models and agent policy. Stage keeps the task, its journal, its final reply and what comes next.

Requirements

  • An OpenCode V2 service that the Stage server (or a worker) can reach. Tested with 2.3.0; any version whose API has the operations Stage uses works. Stage checks them when it connects and names what is missing.
  • OpenCode is a service Stage connects to, so every setup can use it: the desktop app, a self-hosted server, including the Docker image, or a worker.

Connect

Open Settings > Connections, choose Add connection > OpenCode, and pick a method:

  • Connect: OpenCode runs on the Stage server's machine. Stage reads the service's registration file and signs in with its password, which is never stored. From a terminal: stage harness opencode run connect-local.
  • Pairing link: OpenCode runs on another machine. Run opencode pair there and paste the link, or stage harness opencode run pair link=LINK.
  • Advanced: a plain service address, with optional HTTP Basic username and password.

Connecting a different OpenCode service needs confirmation, and the current connection retires. Addresses, the browser and web client URLs, and session renewal: Connections reference.

Workspaces

Workspaces are OpenCode's projects. Add one with the Existing folder source (stage workspaces add, an absolute path on the OpenCode host) when the service supports it; OpenCode creates and owns the project. Browse lists folders anchored to a project OpenCode lists. A workspace row's Rename in OpenCode renames the OpenCode project, never the Stage project title. Projects

Start a task

Select the OpenCode connection and the exact workspace for your task. The workspace supplies the model catalog, variants and primary agents; an empty choice uses OpenCode's defaults. The worktree launch option (off by default) asks OpenCode to create a worktree from its default base.

OpenCode does not take prompt images yet. Options a service cannot honor, such as permission overrides, are listed as unavailable with the reason.

When the session finishes, task detail shows its final reply (up to 4000 characters). Complete the task in Stage to start what depends on it.

Answer and message

Answer in Stage

With a compatible V2 service, the Session tab lists OpenCode's permission requests and the forms Stage can show under Requests. Forms with conditional or external fields are answered in OpenCode.

Message OpenCode in Stage

Send starts a turn on an idle session. During a turn, Steer adds input to it and Queue delivers the message as the next turn. Queued messages lists OpenCode's pending messages and lets you cancel one or steer it into the running turn. Edit and reorder are unavailable: OpenCode keeps enqueue order.

Answer in OpenCode

Open in OpenCode opens the session in the configured web client. With a separate web client configured, task detail also offers Open on service and Copy session ID. A phone must reach that address too: set the Browser URL in the connection's settings (Connections reference).

Auto-complete

Archiving a session in OpenCode completes its successful task while Complete tasks when archived in OpenCode is on (the default). The session action Archive in OpenCode archives it from Stage when the service supports it; the action itself never completes a task, the observed archive does. Auto-complete

Disconnect

stage harness opencode disconnect, or Disconnect in Settings, forgets the address and credentials. Tasks and history stay, and the row stays as Disconnected. A disconnected OpenCode leaves planning and the other harnesses available.

A password change on the OpenCode host revokes a paired session: pair again.

Next steps