Skip to content

Per-agent model configuration has no effect when using ACP #46311

Description

@nate-sentjens

Description

Expected behavior
ACP prompt routing should match CLI behavior in terms of per-agent models taking precedence over the session default.

Actural behavior

  1. The ACP prompt handler always passes the session-level model as input.model to session.prompt(). This short-circuits the fallback chain in prompt.ts, so ag.model is never reached.
  2. loadDirectorySnapshot in service.ts strips agent models when building the mode list, mapping other agent fields but omitting model. Meanwhile the CLI path in directory.ts correctly includes the model spread.

Plugins

None

OpenCode version

1.18.25 (dc4449d)

Steps to reproduce

  1. Configure per-agent models in opencode.jsonc:
{
  "agent": {
    "plan": { "model": "provider/large-model" },
    "build": { "model": "provider/fast-model" }
  }
}
  1. Connect an ACP client (e.g., Xcode) and create a new session
  2. Switch to the "plan" agent via session/set_mode or session/set_config_option
  3. Send a prompt
  4. Observe the provider logs; the prompt is routed to the session-level default model, not provider/large-model
  5. For comparison, run the same agent via the CLI: opencode run --agent plan "hello", where the CLI correctly routes to provider/large-model

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

github-actions commented on Aug 30, 2026

@github-actions
Contributor

This issue might be a duplicate of existing issues. Please check:

If your issue adds new detail (e.g. the loadDirectorySnapshot stripping agent models, or the specific CLI-vs-ACP divergence in directory.ts vs service.ts), that context is still valuable to include in the existing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions