Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions .agents/configs/fallback-chain-config.json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,36 @@
"_docs": "See .agents/tools/ai-assistants/fallback-chains.md for full documentation",

"chains": {
"_comment": "Per-tier fallback chains. Models tried in order. Only use providers configured in OpenCode (anthropic, google). Never use openrouter (expensive gateway).",
"_comment": "Per-tier fallback chains. Anthropic ONLY. Never use openrouter, openai, or google providers for worker dispatch.",

"haiku": [
"anthropic/claude-haiku-4-5",
"google/gemini-2.5-flash"
"anthropic/claude-haiku-4-5"
],
"flash": [
"google/gemini-2.5-flash",
"anthropic/claude-haiku-4-5"
],
"sonnet": [
"anthropic/claude-sonnet-4-5",
"google/gemini-2.5-pro"
"anthropic/claude-sonnet-4-5"
],
"pro": [
"google/gemini-2.5-pro",
"anthropic/claude-sonnet-4-5"
],
"opus": [
"anthropic/claude-opus-4-6",
"google/gemini-2.5-pro"
"anthropic/claude-opus-4-6"
],
"coding": [
"anthropic/claude-opus-4-6",
"anthropic/claude-sonnet-4-5",
"google/gemini-2.5-pro"
"anthropic/claude-sonnet-4-5"
],
"eval": [
"anthropic/claude-sonnet-4-5",
"google/gemini-2.5-flash"
"anthropic/claude-sonnet-4-5"
],
"health": [
"anthropic/claude-sonnet-4-5",
"google/gemini-2.5-flash"
"anthropic/claude-sonnet-4-5"
],

"default": [
"anthropic/claude-sonnet-4-5",
"google/gemini-2.5-pro"
"anthropic/claude-sonnet-4-5"
]
},

Expand Down
16 changes: 8 additions & 8 deletions .agents/scripts/fallback-chain-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ get_chain_for_tier() {
# Use the existing model-availability-helper.sh tier mapping
local tier_spec=""
case "$tier" in
haiku) tier_spec='["anthropic/claude-haiku-4-5","google/gemini-2.5-flash"]' ;;
flash) tier_spec='["google/gemini-2.5-flash","anthropic/claude-haiku-4-5"]' ;;
sonnet) tier_spec='["anthropic/claude-sonnet-4-5","google/gemini-2.5-pro"]' ;;
pro) tier_spec='["google/gemini-2.5-pro","anthropic/claude-sonnet-4-5"]' ;;
opus) tier_spec='["anthropic/claude-opus-4-6","google/gemini-2.5-pro"]' ;;
coding) tier_spec='["anthropic/claude-opus-4-6","google/gemini-2.5-pro"]' ;;
eval) tier_spec='["anthropic/claude-sonnet-4-5","google/gemini-2.5-flash"]' ;;
health) tier_spec='["anthropic/claude-sonnet-4-5","google/gemini-2.5-flash"]' ;;
haiku) tier_spec='["anthropic/claude-haiku-4-5"]' ;;
flash) tier_spec='["anthropic/claude-haiku-4-5"]' ;;
sonnet) tier_spec='["anthropic/claude-sonnet-4-5"]' ;;
pro) tier_spec='["anthropic/claude-sonnet-4-5"]' ;;
opus) tier_spec='["anthropic/claude-opus-4-6"]' ;;
coding) tier_spec='["anthropic/claude-opus-4-6","anthropic/claude-sonnet-4-5"]' ;;
eval) tier_spec='["anthropic/claude-sonnet-4-5"]' ;;
health) tier_spec='["anthropic/claude-sonnet-4-5"]' ;;
*)
print_error "Unknown tier: $tier"
return 1
Expand Down
7 changes: 2 additions & 5 deletions .agents/scripts/supervisor-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2817,14 +2817,11 @@ resolve_model() {
sonnet|eval|health)
echo "anthropic/claude-sonnet-4-5"
;;
haiku)
haiku|flash)
echo "anthropic/claude-haiku-4-5"
;;
flash)
echo "google/gemini-2.5-flash"
;;
pro)
echo "google/gemini-2.5-pro"
echo "anthropic/claude-sonnet-4-5"
;;
Comment on lines 2817 to 2825

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and to reduce redundancy, you can combine the case statements for tiers that resolve to the same model. The pro tier now resolves to the same model as sonnet, eval, and health.

Suggested change
sonnet|eval|health)
echo "anthropic/claude-sonnet-4-5"
;;
haiku)
haiku|flash)
echo "anthropic/claude-haiku-4-5"
;;
flash)
echo "google/gemini-2.5-flash"
;;
pro)
echo "google/gemini-2.5-pro"
echo "anthropic/claude-sonnet-4-5"
;;
sonnet|eval|health|pro)
echo "anthropic/claude-sonnet-4-5"
;;
haiku|flash)
echo "anthropic/claude-haiku-4-5"
;;

*)
# Unknown tier — treat as coding tier default
Expand Down
Loading