{"record":{"id":"64dd84e3955ce530","repo":"Hmbown/CodeWhale","slug":"required-workflow-result-unavailable-id","errorCode":null,"errorMessage":"Required Workflow result unavailable: ' + id","messagePattern":"Required Workflow result unavailable: ' \\+ id","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/workflow/mod.rs","lineNumber":3450,"sourceCode":"            spec.id\n        )));\n    }\n    Ok(())\n}\n\nfn leaf_description_expression(spec: &LeafSpec) -> String {\n    let description = js_string(&leaf_description(spec));\n    if spec.depends_on_results.is_empty() {\n        return description;\n    }\n    let inputs = result_inputs_expression(&spec.depends_on_results);\n    // parallel() retains null for a failed slot. A dependent worker must\n    // not start with an empty stand-in for that result; reducers can still\n    // inspect partial fan-out through their separate input projection.\n    let required =\n        serde_json::to_string(&spec.depends_on_results).expect(\"dependency IDs serialize to JSON\");\n    format!(\n        \"({required}.forEach(id => {{ if (__results[id] == null) throw new Error('Required Workflow result unavailable: ' + id); }}), {description} + \\\"\\\\n\\\\nInputs:\\\\n\\\" + {inputs})\"\n    )\n}\n\nfn result_inputs_expression(inputs: &[String]) -> String {\n    let entries = inputs\n        .iter()\n        .map(|input| format!(\"[{}, __results[{}]]\", js_string(input), js_string(input)))\n        .collect::<Vec<_>>()\n        .join(\", \");\n    format!(\n        \"[{entries}].map(([id, value]) => \\\"--- \\\" + id + \\\" ---\\\\n\\\" + String(value ?? \\\"\\\")).join(\\\"\\\\n\\\\n\\\")\"\n    )\n}\n\nfn leaf_subagent_type(spec: &LeafSpec) -> Option<&'static str> {\n    // A named Fleet profile owns the child's runtime type. Emitting the IR's\n    // default `general` here makes role-only leaves look like an explicit type\n    // override and can conflict with the resolved roster member (for example,","sourceCodeStart":3432,"sourceCodeEnd":3468,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/workflow/mod.rs#L3432-L3468","documentation":"The `key` tool resolver, when given a `duration`, converts the call into a `hold_key` wire tool. A held key occupies the keyboard for its whole duration, so modifiers like `repeat` or a `target` window cannot be honored concurrently — the library rejects the combination up front rather than silently dropping one of the options.","triggerScenarios":"Calling resolveTool with tool \"key\" and args containing a non-null `duration` together with a non-null `repeat` OR a non-null `target`, e.g. key {key:\"a\", duration:1, repeat:3} or key {key:\"Tab\", duration:0.5, target:\"editor\"}.","commonSituations":"Models or scripts conflating the tap-style key tool with the hold-style hold_key tool; copying a key spec that includes repeat count and adding a hold duration to slow it down; migrating prompts from another computer-use API where held keys still support per-window targeting.","solutions":["Remove `repeat` and `target` from the args when `duration` is set — the key is held for `duration` seconds and repeated pressing is not supported.","If you need repeated presses, drop `duration` so it resolves as a plain `key` and issue multiple calls, or call `hold_key` directly and loop yourself.","If you need the key delivered to a specific window, drop `duration` and use `target`, or start a trajectory/window-focus step before holding."],"exampleFix":"// before\nresolveTool(\"key\", { key: \"Shift\", duration: 2, repeat: 3 });\n// after\nresolveTool(\"key\", { key: \"Shift\", duration: 2 }); // or drop duration to keep repeat","handlingStrategy":"validation","validationCode":"if (args.duration != null && (args.repeat != null || args.target != null)) {\n  throw new Error(\"key: drop repeat/target when duration (hold_key) is set\");\n}","typeGuard":"const isHoldKeyArgs = (a) => a.duration != null && a.repeat == null && a.target == null;","tryCatchPattern":null,"preventionTips":["Treat duration on key as switching to the hold_key tool: hold args only carry key + duration.","Keep repeat presses and window targeting in separate plain key calls.","Build key args through one helper that enforces the option groups."],"tags":["argument-validation","computer-use","input-synthesis"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T21:17:16.096Z"}