{"record":{"id":"6d391111af5a78f1","repo":"sxyazi/yazi","slug":"unknown-copy-type","errorCode":null,"errorMessage":"Unknown copy type: {}","messagePattern":"Unknown copy type: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"yazi-actor/src/mgr/copy.rs","lineNumber":54,"sourceCode":"\t\t\t\t\ts.extend_from_slice(&form.separator.transform(&f.url.to_strand()));\n\t\t\t\t}\n\t\t\t\t\"dirpath\" | \"dirname\" => {\n\t\t\t\t\tif let Some(p) = f.content_path().parent() {\n\t\t\t\t\t\ts.extend_from_slice(&form.separator.transform(&p));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"dirurl\" => {\n\t\t\t\t\tif let Some(p) = f.url.parent() {\n\t\t\t\t\t\ts.extend_from_slice(&form.separator.transform(&p.to_strand()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"filename\" => {\n\t\t\t\t\ts.extend_from_slice(&form.separator.transform(&f.name().unwrap_or_default()));\n\t\t\t\t}\n\t\t\t\t\"name_without_ext\" => {\n\t\t\t\t\ts.extend_from_slice(&form.separator.transform(&f.stem().unwrap_or_default()));\n\t\t\t\t}\n\t\t\t\t_ => bail!(\"Unknown copy type: {}\", form.r#type),\n\t\t\t};\n\t\t\tif it.peek().is_some() {\n\t\t\t\ts.push(b'\\n');\n\t\t\t}\n\t\t}\n\n\t\t// Copy the CWD path regardless even if the directory is empty\n\t\tif s.is_empty() && matches!(&*form.r#type, \"dirpath\" | \"dirname\") {\n\t\t\ts.extend_from_slice(&form.separator.transform(&cx.current().content_path()));\n\t\t} else if s.is_empty() && form.r#type == \"dirurl\" {\n\t\t\ts.extend_from_slice(&form.separator.transform(&cx.cwd().to_strand()));\n\t\t}\n\n\t\tfutures::executor::block_on(CLIPBOARD.set(s));\n\t\tsucc!();\n\t}\n}\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-actor/src/mgr/copy.rs#L36-L72","documentation":"Raised by Action::take (yazi-shared/src/event/action.rs:180) when a consuming lookup by DataKey finds nothing in the args map. take() removes the entry (move-out semantics), so beyond a missing argument it also fails on double consumption: a second take of the same name or index after the first one removed it. Every form's TryFrom<ActionCow> is built on take/take_any, so this error surfaces when the incoming action lacks a required argument or was already drained.","triggerScenarios":"A form's TryFrom calling a.take(\"name\")/take_first()/take_second() for an argument the sender never attached; two forms (or a form plus a plugin hook) consuming the same positional argument from one ActionCow; argument name mismatch between emitter and receiver; positional index shift after an earlier argument was omitted.","commonSituations":"Plugin or keymap emitting a command without a required parameter after a yazi version renamed it; internal command re-dispatch paths that try to read an argument already taken by an earlier handler; copy-pasted form code reading the wrong key name.","solutions":["Ensure the emitter attaches the argument with the exact key (with/with_any in Rust, matching table key in Lua) before dispatch","Make sure only one consumer takes a given argument; use get()/any() for read-only inspection and leave take() to the single owner","Verify positional order — take(0) is the first positional, take(1) the second; a missing earlier arg shifts everything","Trace with YAZI_LOG=debug to see the action's args at dispatch time"],"exampleFix":"// before\nlet id: u64 = a.take(\"id\")?; // sender never attached \"id\"\n// after\nlet action = action.with(\"id\", 42u64);\n// ... then dispatch; form's take(\"id\") succeeds","handlingStrategy":"validation","validationCode":"// Rust: attach every argument a form will take\nlet action = Action::new_relay(\"tasks:output\")?.with(\"id\", id).with_any(\"out\", out);","typeGuard":null,"tryCatchPattern":"// Rust: single-owner consumption\nmatch form::Output::try_from(action) { Ok(f) => ..., Err(e) => tracing::warn!(\"bad action: {e:#}\") }","preventionTips":["One consumer per taken argument; use get()/any() for inspection","When forwarding actions, forward the original object instead of rebuilding it","Name arguments identically on both sides of the boundary","Add debug logging (YAZI_LOG=debug) when wiring new commands"],"tags":["rust","event-dispatch","missing-argument","ownership","yazi"],"backgroundTag":"missing-required-argument","analyzedSha":"441b332de8b8800e70784cfbfb75369ab51ed9dd","analyzedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}