model switch also switches provider (gpt models were sent to the Claude API)
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s

This commit is contained in:
hermes committed 2026-10-01 12:15:39 +00:00
1 parent 658ada46f7
commit ad73e8f1c2
7 files changed
+171 -21

No files matched your search

+17 -1
View File
@@ -324,6 +324,11 @@ async fn main() -> Result<()> {
.or(kinds.first().copied())
.unwrap_or(Kind::Claude);
let models = catalog(&kinds).await;
// an explicit model picks its provider unless --provider says otherwise
let kind = match (&cli.provider, cli.model.as_deref().or(cfg.model.as_deref())) {
(None, Some(m)) => hx_ai::models::kind_of(&models, m).unwrap_or(kind),
_ => kind,
};
let model = cli.model.or(cfg.model).unwrap_or_else(|| {
match kind {
Kind::Claude => cfg.claude_model.clone(),
@@ -455,7 +460,18 @@ async fn main() -> Result<()> {
}
let specs = command_specs(&mcp, &cwd, &models, &kinds);
if cli.mode == Mode::Rpc {
let r = rpc::serve(agent, abort, specs, hx_tui::project_files(&cwd), dir).await;
let r = rpc::serve(
agent,
abort,
rpc::Ctx {
specs,
files: hx_tui::project_files(&cwd),
session_dir: dir,
models: models.clone(),
make_provider: provider,
},
)
.await;
mgr.shutdown().await;
return r;
}