ACP: session/set_model returns 'Method not found' error in JetBrains/IntelliJ #7141

Closed
opened 2026-02-16 18:06:17 -05:00 by yindo · 0 comments
Owner

Originally created by @maxious on GitHub (Jan 21, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When using OpenCode as an ACP tool in JetBrains IDEs (IntelliJ, etc.), calling session/set_model fails with:

Error handling request {
  type: "com.agentclientprotocol.rpc.JsonRpcRequest",
  id: 4,
  method: "session/set_model",
  params: {
    sessionId: "ses_...",
    modelId: "amazon-bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0",
  },
  jsonrpc: "2.0",
} {
  code: -32601,
  message: "\"Method not found\": session/set_model",
  data: {
    method: "session/set_model",
  },
}

Root Cause

The ACP TypeScript SDK v0.12.0 renamed the interface method from setSessionModel to unstable_setSessionModel in commit 7072d3f.

The SDK's internal router checks if (!agent.unstable_setSessionModel) and throws MethodNotFound when the method doesn't exist. OpenCode implements setSessionModel (old name) but the SDK looks for unstable_setSessionModel (new name).

Expected Behavior

session/set_model should work and allow model switching in ACP clients.

References

Originally created by @maxious on GitHub (Jan 21, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description When using OpenCode as an ACP tool in JetBrains IDEs (IntelliJ, etc.), calling `session/set_model` fails with: ``` Error handling request { type: "com.agentclientprotocol.rpc.JsonRpcRequest", id: 4, method: "session/set_model", params: { sessionId: "ses_...", modelId: "amazon-bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0", }, jsonrpc: "2.0", } { code: -32601, message: "\"Method not found\": session/set_model", data: { method: "session/set_model", }, } ``` ## Root Cause The ACP TypeScript SDK v0.12.0 renamed the interface method from `setSessionModel` to `unstable_setSessionModel` in commit [7072d3f](https://github.com/agentclientprotocol/typescript-sdk/commit/7072d3f0aae8df8da4f772b3960268f3e7c43364). The SDK's internal router checks `if (!agent.unstable_setSessionModel)` and throws `MethodNotFound` when the method doesn't exist. OpenCode implements `setSessionModel` (old name) but the SDK looks for `unstable_setSessionModel` (new name). ## Expected Behavior `session/set_model` should work and allow model switching in ACP clients. ## References - SDK commit that renamed the method: https://github.com/agentclientprotocol/typescript-sdk/commit/7072d3f - Same issue fixed in Qwen Code: https://github.com/QwenLM/qwen-code/pull/1521
yindo closed this issue 2026-02-16 18:06:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7141