Modify generic name for model tiers

Co-Authored-By: win0na <winnie@winneon.moe>

refactor: neutral model vocabulary (low/mid/high) in source agents

feat(claude-code): cc_model_to_native() maps low/mid/high to haiku/sonnet/opus

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(opencode): update oc_model_to_provider() for low/mid/high vocabulary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nunziati
2026-04-10 11:51:53 +00:00
parent 9a93cd4aa5
commit 5a15e5b79b
13 changed files with 46 additions and 21 deletions

View File

@@ -54,17 +54,17 @@ oc_event_to_native() {
esac
}
# CC-style short model name → opencode provider/model id. Conservative mapping:
# Neutral model tier → opencode provider/model id. Conservative mapping:
# if the source model is already provider-prefixed (contains "/"), pass through
# unchanged. Otherwise look up in the table and fall back to the raw value.
oc_model_to_provider() {
local model="$1"
case "$model" in
*/*) echo "$model" ;; # already qualified
sonnet) echo "anthropic/claude-sonnet-4-5" ;;
opus) echo "anthropic/claude-opus-4-5" ;;
haiku) echo "anthropic/claude-haiku-4-5" ;;
*) echo "$model" ;; # unknown — pass through
*/*) echo "$model" ;; # already qualified
low) echo "anthropic/claude-haiku-4-5" ;;
mid) echo "anthropic/claude-sonnet-4-5" ;;
high) echo "anthropic/claude-opus-4-5" ;;
*) echo "$model" ;; # unknown — passthrough
esac
}