feat: validate config on startup, prompt setup wizard if fields missing

On REPL start, check for missing provider.apiKey, provider.baseUrl,
and subagentModel. Print a warning with instructions to run `claw setup`
or `/setup` if any are absent.

Co-authored-by: GLM 5.1 FP8 via Crush <crush@charm.land>
This commit is contained in:
TheArchitectit 2026-04-29 10:34:01 -05:00
parent 087b5f0f23
commit b537ff7b0f
1 changed files with 23 additions and 0 deletions

View File

@ -7086,6 +7086,29 @@ fn run_repl(
println!("{}", cli.startup_banner());
println!("{}", format_connected_line(&cli.model));
// Validate key config fields and prompt setup wizard if missing
{
let cwd = std::env::current_dir().unwrap_or_default();
if let Ok(config) = runtime::ConfigLoader::default_for(&cwd).load() {
let mut missing: Vec<&str> = Vec::new();
if config.provider().api_key().is_none() {
missing.push("provider.apiKey");
}
if config.provider().base_url().is_none() {
missing.push("provider.baseUrl");
}
if config.subagent_model().is_none() {
missing.push("subagentModel");
}
if !missing.is_empty() {
eprintln!("
Warning: Missing config fields: {}", missing.join(", "));
eprintln!(" Run claw setup or type /setup to configure.
");
}
}
}
// Discover and register LSP servers
let lsp_servers = runtime::lsp_discovery::discover_available_servers();
if !lsp_servers.is_empty() {