You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCodeHarness: serve OpenCode's HTTP API with harness.fetch #2567
Add harness.fetch(request) to OpenCodeHarness. It would serve OpenCode's HTTP API from the Durable Object, so the OpenCode CLI can attach to a hosted session:
@opencode/sdk builds the embedded server's handler (host.fetch) but doesn't return it from OpenCodeWorkerd.create. Asked for it in anomalyco/opencode#54803.
#2483 got the handler by redefining OpenCode.make in @opencode/client and catching its fetch option with AsyncLocalStorage. We're not taking that: it's a monkey-patch, and it breaks when the SDK and the app resolve different copies of @opencode/client.
When it ships
Bump @opencode/sdk and @opencode/plugin.
harness.fetch(request) holds a lease and calls (await this.#open()).fetch(request), so it counts as activity for the idle close.
In the example, add a route under /agents/open-code-agent/<name> that strips the agent prefix (src/cli.ts in Harness opencode #2483), plus a README section on attaching the CLI.
Test: a GET for a session through harness.fetch returns the same session as harness.sessions.list().
Activity