[PR #11410] fix(opencode): scope agent variant to model #13778

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

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

State: closed
Merged: Yes


Fixes #11416

Summary

  • Treat agent.variant as a first-class config field so it doesn't leak into provider options.
  • Apply the variant only when the selected model matches the agent's configured model (prevents OpenAI-compatible providers like Kimi K2.5 from receiving unsupported variant params).

Changes

  • packages/opencode/src/config/config.ts: Add variant as a known field in Config.Agent schema
  • packages/opencode/src/agent/agent.ts: Add variant to Agent.Info and load from config
  • packages/opencode/src/session/prompt.ts: Only apply agent.variant when model matches

Testing

  • Added unit tests in packages/opencode/test/config/config.test.ts
  • Added integration test in packages/opencode/test/session/prompt-variant.test.ts

Note: Tests not run locally due to bun not being available in this environment.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11410 **State:** closed **Merged:** Yes --- Fixes #11416 ## Summary - Treat `agent.variant` as a first-class config field so it doesn't leak into provider options. - Apply the variant only when the selected model matches the agent's configured model (prevents OpenAI-compatible providers like Kimi K2.5 from receiving unsupported `variant` params). ## Changes - `packages/opencode/src/config/config.ts`: Add `variant` as a known field in Config.Agent schema - `packages/opencode/src/agent/agent.ts`: Add `variant` to Agent.Info and load from config - `packages/opencode/src/session/prompt.ts`: Only apply agent.variant when model matches ## Testing - Added unit tests in `packages/opencode/test/config/config.test.ts` - Added integration test in `packages/opencode/test/session/prompt-variant.test.ts` Note: Tests not run locally due to bun not being available in this environment.
yindo added the pull-request label 2026-02-16 18:18:36 -05:00
yindo closed this issue 2026-02-16 18:18:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13778