{"record":{"id":"3b1cda6e233de257","repo":"multica-ai/multica","slug":"prepare-task-local-state-w","errorCode":null,"errorMessage":"prepare task-local state: %w","messagePattern":"prepare task-local state: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/hermes_home.go","lineNumber":402,"sourceCode":"\tif sharedHome == \"\" {\n\t\tsharedHome = platformDefaultHermesHome()\n\t}\n\tif sourceMustExist {\n\t\tif fi, err := os.Stat(sharedHome); err != nil || !fi.IsDir() {\n\t\t\treturn hermesSessionMount{}, fmt.Errorf(\"hermes profile home %q not found (create it with `hermes profile create`)\", sharedHome)\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(hermesHome, 0o700); err != nil {\n\t\treturn hermesSessionMount{}, fmt.Errorf(\"create hermes-home dir: %w\", err)\n\t}\n\t// Tighten perms on reuse too — MkdirAll leaves an existing dir's mode alone,\n\t// and the derived config below can hold inline api_key secrets.\n\tif err := os.Chmod(hermesHome, 0o700); err != nil {\n\t\treturn hermesSessionMount{}, fmt.Errorf(\"chmod hermes-home dir: %w\", err)\n\t}\n\tif err := prepareHermesTaskLocalState(hermesHome); err != nil {\n\t\treturn hermesSessionMount{}, fmt.Errorf(\"prepare task-local state: %w\", err)\n\t}\n\t// Sessions: link state.db at the conversation's persistent store so the\n\t// transcript survives the task. A store that cannot be mounted leaves the\n\t// database task-local — the pre-existing behaviour — rather than failing the\n\t// task. See hermes_sessions.go.\n\tif sessionStore != \"\" {\n\t\tmounted, err := mountHermesSessionDB(hermesHome, sessionStore, logger)\n\t\tif err != nil {\n\t\t\treturn hermesSessionMount{}, fmt.Errorf(\"mount conversation sessions: %w\", err)\n\t\t}\n\t\tsessions = mounted\n\t}\n\t// Memory: link memories/ at the agent's persistent store so it survives the\n\t// task, or fall back to a fresh task-local dir when there is no store (no\n\t// agent to key on, or an unresolvable profile dir). See hermes_memory.go.\n\tif memoryStore != \"\" {\n\t\tif err := mountHermesMemories(hermesHome, memoryStore, logger); err != nil {\n\t\t\treturn hermesSessionMount{}, fmt.Errorf(\"mount agent memories: %w\", err)","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/hermes_home.go#L384-L420","documentation":"Error \"prepare task-local state: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/hermes_home.go:402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error from task-local state preparation."],"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"}