{"record":{"id":"ce20fb04520289f4","repo":"calesthio/OpenMontage","slug":"workspace-path-is-required-for-this-operation","errorCode":null,"errorMessage":"workspace_path is required for this operation","messagePattern":"workspace_path is required for this operation","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/hyperframes_compose.py","lineNumber":991,"sourceCode":"            },\n            artifacts=[str(output_path)],\n        )\n\n    @staticmethod\n    def _file_digest(path: Path) -> str:\n        import hashlib\n\n        return hashlib.sha256(path.read_bytes()).hexdigest()\n\n    # ------------------------------------------------------------------\n    # Workspace generation helpers\n    # ------------------------------------------------------------------\n\n    @staticmethod\n    def _require_workspace(inputs: dict[str, Any]) -> Path:\n        raw = inputs.get(\"workspace_path\")\n        if not raw:\n            raise ValueError(\"workspace_path is required for this operation\")\n        return Path(raw).resolve()\n\n    @staticmethod\n    def _resolve_dimensions(\n        profile_name: Optional[str], fps_in: int\n    ) -> tuple[int, int, int]:\n        \"\"\"Resolve output dimensions from the media profile, with a safe default.\"\"\"\n        if profile_name:\n            try:\n                from lib.media_profiles import get_profile  # type: ignore\n                p = get_profile(profile_name)\n                return int(p.width), int(p.height), int(p.fps)\n            except Exception:\n                pass\n        return 1920, 1080, int(fps_in)\n\n    @staticmethod\n    def _compute_total_duration(cuts: list[dict]) -> float:","sourceCodeStart":973,"sourceCodeEnd":1009,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/hyperframes_compose.py#L973-L1009","documentation":"Raised by _require_workspace in the HyperFrames compose tool when inputs contain no workspace_path. Edit/render-style operations operate on an existing HyperFrames workspace directory, and the helper resolves that path via Path(raw).resolve() — with no value supplied there is nothing to operate on, so it fails fast with ValueError.","triggerScenarios":"Invoking a hyperframes_compose operation that targets an existing workspace (edit/render/inspect) without the workspace_path key, or with it set to None/empty string.","commonSituations":"Assuming the tool remembers the workspace from a previous compose call (it is stateless per invocation); passing project_path or directory instead of workspace_path; key typos; workflow scripts that conditionally set the key and skip it.","solutions":["Add workspace_path pointing at the HyperFrames workspace directory (the one containing the composition).","If starting from scratch, use the create/init operation that accepts a project path instead of an edit operation.","Check for exact key name — workspace_path, not workspace or path.","Persist the workspace path from the creating step and thread it into subsequent edit/render calls."],"exampleFix":"# before\n{\"operation\": \"render\"}\n\n# after\n{\"operation\": \"render\", \"workspace_path\": \"/abs/project/workspaces/promo\"}","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nworkspace = inputs.get(\"workspace_path\")\nif not workspace:\n    raise ValueError(\"workspace_path is required for edit/render operations\")\nws = Path(workspace).expanduser().resolve()\nif not ws.is_dir():\n    raise FileNotFoundError(f\"workspace does not exist: {ws}\")\ninputs[\"workspace_path\"] = str(ws)","typeGuard":"from pathlib import Path\n\ndef is_workspace_dir(v: object) -> bool:\n    return isinstance(v, str) and len(v) > 0 and Path(v).expanduser().resolve().is_dir()","tryCatchPattern":null,"preventionTips":["Thread the workspace path returned by the create step into every subsequent edit/render call.","Store the workspace path in your workflow state file, not in ad-hoc variables."],"tags":["hyperframes","validation","missing-argument","workspace"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}