rivet-dev / rivet-dev/agentos

session/set_config_option unimplemented in opencode@0.2.x; opencode@0.3.x is blocked by an agentos-core package-format mismatch

Open
#1,924 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.6k
Forks
251
Avg merge
2d 15h
Merged PRs (30d)
34

Description

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:

  1. Fix session/set_config_option's underlying implementation in the 0.2.x line, or
  2. 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce both cases with @agentos-software/opencode 0.2.7 and 0.3.2, using AgentOs.create and setSessionConfigOption as the entry points. Read dist/opencode-acp/acp.js for the 0.2.x routing and inspect the package reference passed to AgentOs.create for the 0.3.x packagePath mismatch. Done means custom model selection works on the supported version, or the 0.3.x package boots with the published agentos-core version.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.