Origin: docs/todo.md entry dated 2026-04-01
Plan: docs/plans/plan-inference-engine.md (OpenCode client), docs/architecture.md §How the Shadow Model Works
Description
Create shadow-agent/src/inference/opencode-client.ts by porting sidecar's opencode-client.js. Responsibilities: start the OpenCode server (or attach to an existing one), create a session, send prompts, poll completions, and surface provider-neutral responses. The OpenCode SDK is the primary inference harness because it gives free provider abstraction (Claude, GPT-4, Gemini, OpenRouter) and inherits credentials from the user's existing OpenCode config.
Acceptance criteria
Origin:
docs/todo.mdentry dated 2026-04-01Plan:
docs/plans/plan-inference-engine.md(OpenCode client),docs/architecture.md§How the Shadow Model WorksDescription
Create
shadow-agent/src/inference/opencode-client.tsby porting sidecar'sopencode-client.js. Responsibilities: start the OpenCode server (or attach to an existing one), create a session, send prompts, poll completions, and surface provider-neutral responses. The OpenCode SDK is the primary inference harness because it gives free provider abstraction (Claude, GPT-4, Gemini, OpenRouter) and inherits credentials from the user's existing OpenCode config.Acceptance criteria
@opencode-ai/sdkbehind the sharedInferenceClientseam atsrc/inference/inference-client.ts