{"record":{"id":"acdc9487e22bfbee","repo":"sxyazi/yazi","slug":"invalid-out-in-outputform","errorCode":null,"errorMessage":"Invalid 'out' in OutputForm","messagePattern":"Invalid 'out' in OutputForm","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-parser/src/tasks/output.rs","lineNumber":18,"sourceCode":"use anyhow::anyhow;\nuse mlua::{ExternalError, FromLua, IntoLua, Lua, Value};\nuse yazi_scheduler::custom::CustomOut;\nuse yazi_shared::{event::ActionCow, id::Id};\n\n#[derive(Debug)]\npub struct OutputForm {\n\tpub id:  Id,\n\tpub out: CustomOut,\n}\n\nimpl TryFrom<ActionCow> for OutputForm {\n\ttype Error = anyhow::Error;\n\n\tfn try_from(mut a: ActionCow) -> Result<Self, Self::Error> {\n\t\tOk(Self {\n\t\t\tid:  a.get(\"id\")?,\n\t\t\tout: a.take_any(\"out\").ok_or_else(|| anyhow!(\"Invalid 'out' in OutputForm\"))?,\n\t\t})\n\t}\n}\n\nimpl FromLua for OutputForm {\n\tfn from_lua(_: Value, _: &Lua) -> mlua::Result<Self> { Err(\"unsupported\".into_lua_err()) }\n}\n\nimpl IntoLua for OutputForm {\n\tfn into_lua(self, _: &Lua) -> mlua::Result<Value> { Err(\"unsupported\".into_lua_err()) }\n}\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-parser/src/tasks/output.rs#L1-L30","documentation":"OutputForm carries a completed task's id and its 'out' value (process output channel/data) back to a waiting caller. Both fields are required: 'id' is fetched with a.get(\"id\")? (its own conversion error possible), and 'out' with a.take_any(\"out\") — if 'out' is missing or of the wrong type, \"Invalid 'out' in OutputForm\" is raised. Without it the replier cannot deliver the task output.","triggerScenarios":"Dispatching tasks.output without an 'out' entry, or with an 'out' value that cannot be taken as the expected output type; also if 'id' is missing/invalid the get(\"id\")? error fires first.","commonSituations":"Custom task implementations replying without attaching the output value; version drift in the output payload representation; forwarding the reply through code that drops extra values.","solutions":["Attach the task output under key 'out' when constructing the tasks.output action.","Also ensure a valid task 'id' is present, since get(\"id\")? runs before 'out' is checked.","Match the out type to OutputForm in yazi-parser/src/tasks/output.rs for your yazi version.","Reply via the task's built-in replier/callback path rather than assembling the action by hand."],"exampleFix":"// before\nlet a = ActionCow::from(\"tasks.output\").with(\"id\", id); // missing out\n// after\nlet a = ActionCow::from(\"tasks.output\").with(\"id\", id).with(\"out\", out);","handlingStrategy":"validation","validationCode":"if action.get(\"id\").is_err() || !action.has(\"out\") {\n    anyhow::bail!(\"tasks.output requires both 'id' and 'out'\");\n}\nlet form = OutputForm::try_from(action)?;","typeGuard":"fn has_out(a: &ActionCow) -> bool { a.has(\"out\") }","tryCatchPattern":"match OutputForm::try_from(action) {\n    Ok(form) => form.reply(),\n    Err(e) => tracing::error!(\"task reply dropped: {e:#}\"),\n}","preventionTips":["Always reply through the task's replier so id and out are attached together.","Check 'id' first — get(\"id\")? fails before the 'out' check.","Keep output payload types aligned with OutputForm after upgrades."],"tags":["rust","action-parsing","missing-field","tasks","yazi"],"backgroundTag":"missing-required-action-field","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}