{"record":{"id":"6910f69d65711d40","repo":"multica-ai/multica","slug":"execenv-task-id-is-required","errorCode":null,"errorMessage":"execenv: task ID is required","messagePattern":"execenv: task ID is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/execenv.go","lineNumber":335,"sourceCode":"func PredictRootDir(workspacesRoot, workspaceID, taskID string) string {\n\tif workspacesRoot == \"\" || workspaceID == \"\" || taskID == \"\" {\n\t\treturn \"\"\n\t}\n\treturn filepath.Join(workspacesRoot, workspaceID, shortID(taskID))\n}\n\n// Prepare creates an isolated execution environment for a task.\n// The workdir starts empty (no repo checkouts). The agent checks out repos\n// on demand via `multica repo checkout <url>`.\nfunc Prepare(params PrepareParams, logger *slog.Logger) (*Environment, error) {\n\tif params.WorkspacesRoot == \"\" {\n\t\treturn nil, fmt.Errorf(\"execenv: workspaces root is required\")\n\t}\n\tif params.WorkspaceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"execenv: workspace ID is required\")\n\t}\n\tif params.TaskID == \"\" {\n\t\treturn nil, fmt.Errorf(\"execenv: task ID is required\")\n\t}\n\n\tenvRoot := filepath.Join(params.WorkspacesRoot, params.WorkspaceID, shortID(params.TaskID))\n\n\t// Self-heal the root-level daemon marker on every task start so a marker\n\t// removed while the daemon runs is restored before the agent spawns. The\n\t// per-workdir marker written below only covers cwds inside the workdir;\n\t// the root marker keeps the CLI fail-closed guard active for subprocesses\n\t// that lose all MULTICA_* env vars AND escape above the workdir. Non-fatal:\n\t// without it the workdir marker still protects the common case.\n\tif err := EnsureWorkspacesRootMarker(params.WorkspacesRoot); err != nil && logger != nil {\n\t\tlogger.Warn(\"execenv: workspaces root marker not written; fail-closed guard limited to the task workdir\", \"error\", err)\n\t}\n\n\t// Remove existing env if present (defensive — task IDs are unique).\n\tif _, err := os.Stat(envRoot); err == nil {\n\t\tif err := os.RemoveAll(envRoot); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"execenv: remove existing env: %w\", err)","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/execenv.go#L317-L353","documentation":"Error \"execenv: task ID is required\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/execenv.go:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the task ID for the execution environment."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}