{"record":{"id":"cca043b1943e24fc","repo":"sigoden/aichat","slug":"unknown-agent-name","errorCode":null,"errorMessage":"Unknown agent `{name}`","messagePattern":"Unknown agent `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/agent.rs","lineNumber":41,"sourceCode":"    shared_variables: AgentVariables,\n    session_variables: Option<AgentVariables>,\n    shared_dynamic_instructions: Option<String>,\n    session_dynamic_instructions: Option<String>,\n    functions: Functions,\n    rag: Option<Arc<Rag>>,\n    model: Model,\n}\n\nimpl Agent {\n    pub async fn init(\n        config: &GlobalConfig,\n        name: &str,\n        abort_signal: AbortSignal,\n    ) -> Result<Self> {\n        let functions_dir = Config::agent_functions_dir(name);\n        let definition_file_path = functions_dir.join(\"index.yaml\");\n        if !definition_file_path.exists() {\n            bail!(\"Unknown agent `{name}`\");\n        }\n        let functions_file_path = functions_dir.join(\"functions.json\");\n        let rag_path = Config::agent_rag_file(name, DEFAULT_AGENT_NAME);\n        let config_path = Config::agent_config_file(name);\n        let mut agent_config = if config_path.exists() {\n            AgentConfig::load(&config_path)?\n        } else {\n            AgentConfig::new(&config.read())\n        };\n        let mut definition = AgentDefinition::load(&definition_file_path)?;\n        let functions = if functions_file_path.exists() {\n            Functions::init(&functions_file_path)?\n        } else {\n            Functions::default()\n        };\n        definition.replace_tools_placeholder(&functions);\n\n        agent_config.load_envs(&definition.name);","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/config/agent.rs#L23-L59","documentation":"Guard in Agent::init: the requested agent name has no corresponding definition, because <agent-functions-dir>/<name>/index.yaml does not exist. The input at fault is the agent name passed on the command line or from config — it was never installed/created, is misspelled, or lives in a different functions directory.","triggerScenarios":"Thrown at src/config/agent.rs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List installed agents to see which names are actually available and correct the typo","Create the agent with its scaffold command so the index.yaml definition file is generated","Check that AGENT_FUNCTIONS_DIR or the equivalent setting points at the directory containing the agent","Add a fuzzy-match suggestion ('did you mean X?') when a similarly named agent exists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}