feat(onboard): refresh model discovery and canonicalize provider aliases (#341)

* feat(onboard): add model refresh command with ttl cache

* fix(onboard): refresh curated models and canonicalize provider aliases

* fix(channels): align agent_turn call signature

* fix(channels): call run_tool_call_loop for stable channel runtime
This commit is contained in:
Chummy 2026-02-16 22:32:30 +08:00 committed by GitHub
parent 0995c57776
commit c842ece12c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1150 additions and 148 deletions

View file

@ -178,6 +178,12 @@ enum Commands {
cron_command: CronCommands,
},
/// Manage provider model catalogs
Models {
#[command(subcommand)]
model_command: ModelCommands,
},
/// Manage channels (telegram, discord, slack)
Channel {
#[command(subcommand)]
@ -235,6 +241,20 @@ enum CronCommands {
},
}
#[derive(Subcommand, Debug)]
enum ModelCommands {
/// Refresh and cache provider models
Refresh {
/// Provider name (defaults to configured default provider)
#[arg(long)]
provider: Option<String>,
/// Force live refresh and ignore fresh cache
#[arg(long)]
force: bool,
},
}
#[derive(Subcommand, Debug)]
enum ChannelCommands {
/// List configured channels
@ -435,6 +455,12 @@ async fn main() -> Result<()> {
Commands::Cron { cron_command } => cron::handle_command(cron_command, &config),
Commands::Models { model_command } => match model_command {
ModelCommands::Refresh { provider, force } => {
onboard::run_models_refresh(&config, provider.as_deref(), force)
}
},
Commands::Service { service_command } => service::handle_command(&service_command, &config),
Commands::Doctor => doctor::run(&config),