{"record":{"id":"d488a84bb6257b0e","repo":"multica-ai/multica","slug":"execenv-restrict-task-local-multica-config-direct","errorCode":null,"errorMessage":"execenv: restrict task-local Multica config directory: %w","messagePattern":"execenv: restrict task-local Multica config directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/execenv.go","lineNumber":378,"sourceCode":"\t// envRoot.\n\tworkDir := filepath.Join(envRoot, \"workdir\")\n\tscratchDirs := []string{filepath.Join(envRoot, \"output\"), filepath.Join(envRoot, \"logs\")}\n\tif params.LocalWorkDir == \"\" && params.LocalWorktree == nil {\n\t\tscratchDirs = append(scratchDirs, workDir)\n\t} else if params.LocalWorkDir != \"\" {\n\t\tworkDir = params.LocalWorkDir\n\t}\n\tfor _, dir := range scratchDirs {\n\t\tif err := os.MkdirAll(dir, 0o755); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"execenv: create directory %s: %w\", dir, err)\n\t\t}\n\t}\n\tmulticaConfigRoot := filepath.Join(envRoot, \"multica-config\")\n\tif err := os.MkdirAll(multicaConfigRoot, 0o700); err != nil {\n\t\treturn nil, fmt.Errorf(\"execenv: create task-local Multica config directory: %w\", err)\n\t}\n\tif err := os.Chmod(multicaConfigRoot, 0o700); err != nil {\n\t\treturn nil, fmt.Errorf(\"execenv: restrict task-local Multica config directory: %w\", err)\n\t}\n\n\t// Worktree mode: build the task's own checkout of the user's repo inside\n\t// envRoot and use it as the workdir. Done before any context file is\n\t// written so the sidecars land inside the disposable worktree instead of\n\t// the user's directory.\n\tvar localWorktree *LocalWorktree\n\t// Tracks whether Prepare reached its successful return. Everything after\n\t// worktree creation can still fail — context files, provider homes, MCP\n\t// config — and on those paths the caller never receives an Environment, so\n\t// nothing downstream knows a worktree exists to clean up. Without the\n\t// rollback below, each such failure would leave a registration in the\n\t// user's repo and a branch that no task ever ran in.\n\tprepareSucceeded := false\n\tif params.LocalWorktree != nil {\n\t\twtParams := *params.LocalWorktree\n\t\twtParams.EnvRoot = envRoot\n\t\twtParams.AgentName = params.AgentName","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/execenv.go#L360-L396","documentation":"Error \"execenv: restrict task-local Multica config directory: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/execenv.go:378 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions to restrict the task-local config directory."],"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-15T22:17:37.221Z"}