{"record":{"id":"46ba486d3b69bce7","repo":"toeverything/AFFiNE","slug":"action-recipe-not-found","errorCode":null,"errorMessage":"Action recipe not found","messagePattern":"Action recipe not found","errorType":"validation","errorClass":"napi::Error","httpStatus":null,"severity":"error","filePath":"packages/backend/native/src/llm/action/catalog.rs","lineNumber":20,"sourceCode":"use serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\n#[serde(rename_all = \"camelCase\")]\nstruct ActionRecipe<'a> {\n  action_id: &'a str,\n  action_version: &'a str,\n  slot: &'a str,\n  prompt_ref: &'a str,\n  response_contract: Value,\n  output_projection: &'a str,\n}\n\n#[napi_derive::napi]\npub fn copilot_action_recipe(action_id: String, action_version: Option<String>) -> Result<String> {\n  let version = action_version.as_deref().unwrap_or(\"v1\");\n  if version != \"v1\" {\n    return Err(Error::new(Status::InvalidArg, \"Action recipe not found\"));\n  }\n  let recipe = match action_id.as_str() {\n    \"mindmap.generate\" => structured(&action_id, \"mindmap.generate\", text_result_schema()),\n    \"slides.outline\" => structured(&action_id, \"slides.outline\", text_result_schema()),\n    \"transcript.audio\" => structured(\n      &action_id,\n      \"Transcript audio structured\",\n      super::super::contract_schema::transcript_result_schema(),\n    ),\n    \"image.filter.sketch\" | \"image.filter.clay\" | \"image.filter.anime\" | \"image.filter.pixel\" => ActionRecipe {\n      action_id: &action_id,\n      action_version: \"v1\",\n      slot: match action_id.as_str() {\n        \"image.filter.sketch\" => \"action.image.filter.sketch\",\n        \"image.filter.clay\" => \"action.image.filter.clay\",\n        \"image.filter.anime\" => \"action.image.filter.anime\",\n        _ => \"action.image.filter.pixel\",\n      },","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/backend/native/src/llm/action/catalog.rs#L2-L38","documentation":"copilot_action_recipe NAPI function could not resolve the requested recipe: either the version is not 'v1' or the action_id has no matching recipe in the embedded catalog, so an InvalidArg error is returned to the JS caller.","triggerScenarios":"Returned by copilot_action_recipe when the requested action_version is not v1 or the action_id does not match any built-in recipe such as mindmap.generate, slides.outline, transcript.audio, or the image.filter actions.","commonSituations":"The requested copilot action id or version is not registered in the native catalog. Check the action id spelling and use version v1.","solutions":["Use an action id present in the catalog.","Register the missing action recipe."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}