[PR #4006] Fixed ACP to respect user's default model config. #10841

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

Original Pull Request: https://github.com/anomalyco/opencode/pull/4006

State: closed
Merged: Yes


Summary

I've fixed the issue where the ACP agent was ignoring the user's configured default model. The problem was in the ACP agent instantiation in /home/runner/work/opencode/opencode/packages/opencode/src/cli/cmd/acp.ts.

Changes made:

  1. Modified ACP command (packages/opencode/src/cli/cmd/acp.ts):

    • Added imports for Config and Provider
    • Changed the AgentSideConnection callback to be async
    • Read user configuration using Config.get()
    • Parse the configured model (if any) and pass it to the ACP agent
  2. Enhanced fallback logic (packages/opencode/src/acp/agent.ts):

    • Added import for Config (removed type-only import)
    • Updated defaultModel function to fall back to reading from Config.get() if no model is provided in ACP config

How it works:

  • When the ACP server starts, it now reads the user's configuration
  • If a default model is configured (e.g., "model": "anthropic/claude-sonnet-4-5-20250929"), it gets parsed and passed to the ACP agent
  • The ACP agent uses this model instead of defaulting to "big-pickle"
  • If no model is configured, it still falls back to the provider's default model

The fix ensures that user-configured default models are respected in ACP sessions while maintaining backward compatibility.

Closes #4001

New%20session%20-%202025-11-06T22%3A11%3A08.688Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4006 **State:** closed **Merged:** Yes --- ## Summary I've fixed the issue where the ACP agent was ignoring the user's configured default model. The problem was in the ACP agent instantiation in `/home/runner/work/opencode/opencode/packages/opencode/src/cli/cmd/acp.ts`. **Changes made:** 1. **Modified ACP command** (`packages/opencode/src/cli/cmd/acp.ts`): - Added imports for `Config` and `Provider` - Changed the AgentSideConnection callback to be async - Read user configuration using `Config.get()` - Parse the configured model (if any) and pass it to the ACP agent 2. **Enhanced fallback logic** (`packages/opencode/src/acp/agent.ts`): - Added import for `Config` (removed type-only import) - Updated `defaultModel` function to fall back to reading from `Config.get()` if no model is provided in ACP config **How it works:** - When the ACP server starts, it now reads the user's configuration - If a default model is configured (e.g., `"model": "anthropic/claude-sonnet-4-5-20250929"`), it gets parsed and passed to the ACP agent - The ACP agent uses this model instead of defaulting to "big-pickle" - If no model is configured, it still falls back to the provider's default model The fix ensures that user-configured default models are respected in ACP sessions while maintaining backward compatibility. Closes #4001 <a href="https://opencode.ai/s/N9Y1bj9t"><img width="200" alt="New%20session%20-%202025-11-06T22%3A11%3A08.688Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI1LTExLTA2VDIyOjExOjA4LjY4OFo=.png?model=opencode/glm-4.6&version=1.0.36&id=N9Y1bj9t" /></a> [opencode session](https://opencode.ai/s/N9Y1bj9t)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/sst/opencode/actions/runs/19151384931)
yindo added the pull-request label 2026-02-16 18:15:35 -05:00
yindo closed this issue 2026-02-16 18:15:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10841