Summary
Using @agentos-software/opencode with a non-default model provider (e.g. OpenRouter) is currently impossible in any published version:
- On opencode@0.2.7 (latest stable), the ACP method that actually changes the selected model, session/set_config_option, has no working implementation - it returns "Method not found" even though the config option is declared as writable.
- The next version line, opencode@0.3.1/0.3.2 (published on npm, not yet tagged latest), appears to fix this, but its package registration format is incompatible with every currently-published @rivet-dev/agentos-core (checked both latest @ 0.2.15 and rc @ 0.2.16-rc.2) - AgentOs.create() throws immediately:
agentOS package ref uses removed field "packageDir" (value: ".../node_modules/@agentos-software/opencode/dist/package/"); packages are referenced by a single packagePath — update the package (rebuild @agentos-software/* dependencies) or pass { packagePath }
Repro (0.2.7 - model selection broken)
import { AgentOs } from "@rivet-dev/agentos-core";
import opencode from "@agentos-software/opencode"; // 0.2.7
const vm = await AgentOs.create({ software: [opencode], database: { type: "sqlite_file", path: "/tmp/repro.sqlite" } });
await vm.openSession({ sessionId: "s1", agent: "opencode", env: { OPENROUTER_API_KEY: "..." } });
await vm.setSessionConfigOption({ sessionId: "s1", optionId: "model", value: "openrouter/anthropic/claude-haiku-4.5" });
// throws: Method not found
Root cause traced in the bundled source (@agentos-software/opencode/dist/opencode-acp/acp.js): the ACP routing for session/set_config_option exists, but the underlying setSessionConfigOption implementation it delegates to isn't wired up to actually change the model in this build.
Repro (0.3.2 - blocked before it even gets there)
npm install @agentos-software/opencode@0.3.2
Then any AgentOs.create({ software: [opencode], ... }) throws the packageDir/packagePath error above, before a session can even open. Same result against @rivet-dev/agentos-core@0.2.16-rc.2.
Impact
Any self-hosted setup using OpenCode as a harness with a custom model provider is stuck — can't select a model on 0.2.x, can't even boot on 0.3.x. This also blocks anything relying on OpenCode specifically for its MCP tool-calling support, since no prompt can complete at all regardless of MCP.
Ask
Either:
- Fix session/set_config_option's underlying implementation in the 0.2.x line, or
- Publish an @rivet-dev/agentos-core version that supports 0.3.x's packagePath format (as latest or rc), so the fix in 0.3.x is actually usable.
Happy to provide a minimal repro repo if useful.
Summary
Using @agentos-software/opencode with a non-default model provider (e.g. OpenRouter) is currently impossible in any published version:
agentOS package ref uses removed field "packageDir" (value: ".../node_modules/@agentos-software/opencode/dist/package/"); packages are referenced by a single
packagePath— update the package (rebuild @agentos-software/* dependencies) or pass { packagePath }Repro (0.2.7 - model selection broken)
Root cause traced in the bundled source (@agentos-software/opencode/dist/opencode-acp/acp.js): the ACP routing for session/set_config_option exists, but the underlying setSessionConfigOption implementation it delegates to isn't wired up to actually change the model in this build.
Repro (0.3.2 - blocked before it even gets there)
npm install @agentos-software/opencode@0.3.2
Then any AgentOs.create({ software: [opencode], ... }) throws the packageDir/packagePath error above, before a session can even open. Same result against @rivet-dev/agentos-core@0.2.16-rc.2.
Impact
Any self-hosted setup using OpenCode as a harness with a custom model provider is stuck — can't select a model on 0.2.x, can't even boot on 0.3.x. This also blocks anything relying on OpenCode specifically for its MCP tool-calling support, since no prompt can complete at all regardless of MCP.
Ask
Either:
Happy to provide a minimal repro repo if useful.