{"record":{"id":"ea0e568be9c03c64","repo":"sigoden/aichat","slug":"invalid-starter-value","errorCode":null,"errorMessage":"Invalid starter value","messagePattern":"Invalid starter value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/repl/mod.rs","lineNumber":498,"sourceCode":"            },\n            \".starter\" => match args {\n                Some(id) => {\n                    let mut text = None;\n                    if let Some(agent) = config.read().agent.as_ref() {\n                        for (i, value) in agent.conversation_staters().iter().enumerate() {\n                            if (i + 1).to_string() == id {\n                                text = Some(value.clone());\n                            }\n                        }\n                    }\n                    match text {\n                        Some(text) => {\n                            println!(\"{}\", dimmed_text(&format!(\">> {text}\")));\n                            let input = Input::from_str(config, &text, None);\n                            ask(config, abort_signal.clone(), input, true).await?;\n                        }\n                        None => {\n                            bail!(\"Invalid starter value\");\n                        }\n                    }\n                }\n                None => {\n                    let banner = config.read().agent_banner()?;\n                    config.read().print_markdown(&banner)?;\n                }\n            },\n            \".save\" => match split_first_arg(args) {\n                Some((\"role\", name)) => {\n                    config.write().save_role(name)?;\n                }\n                Some((\"session\", name)) => {\n                    config.write().save_session(name)?;\n                }\n                _ => {\n                    println!(r#\"Usage: .save <role|session> [name]\"#)\n                }","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/repl/mod.rs#L480-L516","documentation":"The `.starter` REPL command loads the agent's starter prompt and feeds it to the session; when the agent has no starter text configured (`starter` is None), the command bails with 'Invalid starter value'. The library requires a non-empty starter string to execute this command.","triggerScenarios":"Running `.starter` while the active agent's configuration has no `starter` field set (or it resolves to None).","commonSituations":"Switching to an agent whose config lacks a starter prompt; a typo or empty string in the agent's starter configuration; using .starter on a built-in agent that defines no starter.","solutions":["Set a `starter` value in the active agent's configuration","Use a different agent that defines a starter before running .starter","Use normal chat input instead of .starter when no starter is configured"],"exampleFix":"// agents/myagent.yml — before\nname: myagent\n// after\nname: myagent\nstarter: \"Summarize this repository\"","handlingStrategy":"validation","validationCode":"let has_starter = agent_config\n    .get(\"starter\")\n    .map(|s| !s.as_str().unwrap_or(\"\").is_empty())\n    .unwrap_or(false);\nif !has_starter { eprintln!(\"Agent has no starter; .starter will fail\"); }","typeGuard":"fn agent_has_starter(cfg: &AgentConfig) -> bool {\n    cfg.starter.as_deref().map(|s| !s.trim().is_empty()).unwrap_or(false)\n}","tryCatchPattern":"if let Err(e) = run_repl_command(...).await {\n    if e.to_string() == \"Invalid starter value\" {\n        eprintln!(\"This agent has no starter configured; set `starter:` in the agent config\");\n    } else { return Err(e); }\n}","preventionTips":["Define a starter in every agent config where you plan to use .starter","Re-read agent configs after editing to confirm the starter field survived","Prefer direct chat input when no starter is defined"],"tags":["repl","config","agent"],"backgroundTag":"missing-required-config-field","analyzedSha":"82976d349ad97ac9aae0655ad631dace5e2a6385","analyzedAt":"2026-09-09T18:33:06.139Z","contentChangedAt":"2026-09-09T18:33:06.139Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}