[PR #11352] feat: add model aliases #13752

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

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

State: open
Merged: No


Closes #3439

This is my first PR to OpenCode. I've done my best to follow the contributing guidelines and code style, but I fully expect maintainers may want adjustments to the code, documentation, or both. Happy to iterate based on feedback.

Summary

Adds model_aliases config option to map short names to provider/model strings. Aliases work anywhere a model ID is accepted.
Example

{
  model_aliases: {
    cheap: anthropic/claude-3-haiku,
    acme/reasoning: openai/gpt-5
  },
  model: cheap
}

One concern: I introduced an async resolveModel() function (since it needs config access). Most call sites were already async, but I'd appreciate a sanity check that this doesn't cause issues I'm not aware of.

Verification

  • Added 12 unit tests for resolveAlias() and resolveModel()
  • Tested manually
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11352 **State:** open **Merged:** No --- Closes #3439 This is my first PR to OpenCode. I've done my best to follow the contributing guidelines and code style, but I fully expect maintainers may want adjustments to the code, documentation, or both. Happy to iterate based on feedback. #### Summary Adds `model_aliases` config option to map short names to provider/model strings. Aliases work anywhere a model ID is accepted. Example ``` { model_aliases: { cheap: anthropic/claude-3-haiku, acme/reasoning: openai/gpt-5 }, model: cheap } ``` One concern: I introduced an async resolveModel() function (since it needs config access). Most call sites were already async, but I'd appreciate a sanity check that this doesn't cause issues I'm not aware of. #### Verification - Added 12 unit tests for resolveAlias() and resolveModel() - Tested manually
yindo added the pull-request label 2026-02-16 18:18: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#13752