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
15 changes: 8 additions & 7 deletions src/cmd/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::BTreeMap;

use crate::auth::acquire_api_key;
use crate::config::{write_config, DEFAULT_PROFILE};
use crate::http::{fetch_models, most_used_model_id};
use crate::http::fetch_models;
use crate::install::ensure_tool_installed;
use crate::key::{
load_config_if_present, profile_for_agent, resolve_base_url, resolve_launch_api_key,
Expand Down Expand Up @@ -44,14 +44,15 @@ pub(crate) fn resolve_session_model(
context_window: None,
};
};
let id = if is_auto_model(&requested) {
most_used_model_id(&models).unwrap_or(requested)
} else {
requested
};
// Keep `auto` / `anyrouter/auto` as-is so the gateway applies the full
// preset failover chain on the first turn — pinning a single concrete model
// here would defeat anyrouter/auto's cross-model failover (north star:
// "fewer models that work"). The live `/models` lookup still contributes the
// context-window probe used for Claude's 1M-context suffix decision below.
let id = requested;
let context_window = models
.iter()
.find(|m| catalog_model_id(&m.id) == id)
.find(|m| is_auto_model(&m.id))
.and_then(|m| m.context_length);
ResolvedModel { id, context_window }
}
Expand Down
5 changes: 4 additions & 1 deletion src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Launches the coding agent through AnyRouter (signs in first if needed).

Options:
--yes, --ok Skip confirmation prompts (login / install)
--model auto|<id> Session model. \"auto\" picks the most-used catalog model
--model auto|<id> Session model. Default (no flag) = \"auto\" → \
anyrouter/auto on a fresh install; \"auto\" resolves to the most-used \
catalog model on an authed key, else anyrouter/auto. Omit to let failover \
pick the best stable model per turn.
--haiku <id> Claude /model haiku and subagents
--sonnet <id> Claude /model sonnet
--opus <id> Claude /model opus
Expand Down
Loading