[GH-ISSUE #315] bug: OpenCode agent adapter is incompatible with OpenCode V2 #228

Open
opened 2026-10-18 14:03:58 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @BrewerSeth on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/315

Environment

  • Computer (cptr): 0.9.21
  • OpenCode: 2.0.26
  • Linux, native host installation
  • OpenCode Agents profile: absolute executable path, empty Server URL (spawned loopback server)

Reproduction

  1. Configure a working OpenCode Agents profile with OpenCode V1.
  2. Upgrade the same opencode executable to V2.
  3. Send a message through the profile.

Expected: model discovery and agent conversations continue working, or Computer clearly reports an unsupported major version.

Actual: the released adapter cannot communicate using the V2 contract.

Why this happens

OpenCode V2 intentionally changed its server API, but Computer's adapter still implements V1. The profile launches the installed executable without selecting a version-compatible adapter:

  • V1 routes such as /session and /session/{id}/prompt_async no longer match V2's /api/session and /api/session/{id}/prompt.
  • Session/model/prompt request bodies and streaming event schemas changed.
  • V2 opencode serve generates a password after printing its listening URL; the adapter does not capture it for authenticated requests.

This is a major-version compatibility gap, not a networking problem or a dependency on a separately managed OpenCode web service. See the OpenCode V2 migration guide.

Workaround verified locally

A local version-dispatched adapter captures the generated password in memory, uses V2 routes and request bodies, and polls projected messages for text/tool updates. Model detection, a synthetic native-tool read, and follow-up recall with the same session ID after spawned-server teardown passed. Eight synthetic regression tests also passed. Browser acceptance remains pending.

Related: #212 and #222 concern older adapter/startup failures; this report specifically covers the V2 contract change.

Originally created by @BrewerSeth on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/open-webui/computer/issues/315 ## Environment - Computer (`cptr`): 0.9.21 - OpenCode: 2.0.26 - Linux, native host installation - OpenCode Agents profile: absolute executable path, empty Server URL (spawned loopback server) ## Reproduction 1. Configure a working OpenCode Agents profile with OpenCode V1. 2. Upgrade the same `opencode` executable to V2. 3. Send a message through the profile. Expected: model discovery and agent conversations continue working, or Computer clearly reports an unsupported major version. Actual: the released adapter cannot communicate using the V2 contract. ## Why this happens OpenCode V2 intentionally changed its server API, but Computer's adapter still implements V1. The profile launches the installed executable without selecting a version-compatible adapter: - V1 routes such as `/session` and `/session/{id}/prompt_async` no longer match V2's `/api/session` and `/api/session/{id}/prompt`. - Session/model/prompt request bodies and streaming event schemas changed. - V2 `opencode serve` generates a password after printing its listening URL; the adapter does not capture it for authenticated requests. This is a major-version compatibility gap, not a networking problem or a dependency on a separately managed OpenCode web service. See the [OpenCode V2 migration guide](https://opencode.ai/v2/docs/migrate-v1/). ## Workaround verified locally A local version-dispatched adapter captures the generated password in memory, uses V2 routes and request bodies, and polls projected messages for text/tool updates. Model detection, a synthetic native-tool read, and follow-up recall with the same session ID after spawned-server teardown passed. Eight synthetic regression tests also passed. Browser acceptance remains pending. Related: #212 and #222 concern older adapter/startup failures; this report specifically covers the V2 contract change.
Author
Owner

@owui-terminator[bot] commented on GitHub (Oct 12, 2026):

🔍 Related Issues Found

I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:

  1. 🟢 #212 bug: opencode agent profiles never work — adapter requests OpenAPI operationIds as URL paths
    This issue reports the same OpenCode adapter area and the same prompt/session flow breaking, caused by mismatches between Computer's adapter and OpenCode's server API. Although #212 focuses on operationId/path mapping in V1, it is directly related to the adapter incompatibility discussed here.
    by ThalynLabs

💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.

This comment was generated automatically. React with 👍 if helpful, 👎 if not.

<!-- gh-comment-id:6115823838 --> @owui-terminator[bot] commented on GitHub (Oct 12, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟢 [#212](https://github.com/open-webui/computer/issues/212) **bug: opencode agent profiles never work — adapter requests OpenAPI operationIds as URL paths** *This issue reports the same OpenCode adapter area and the same prompt/session flow breaking, caused by mismatches between Computer's adapter and OpenCode's server API. Although #212 focuses on operationId/path mapping in V1, it is directly related to the adapter incompatibility discussed here.* *by ThalynLabs* --- 💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead. *This comment was generated automatically.* React with 👍 if helpful, 👎 if not.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/computer#228
No description provided.