{"record":{"id":"951edd04c06a2ba6","repo":"multica-ai/multica","slug":"ensure-codex-sandbox-config-w","errorCode":null,"errorMessage":"ensure codex sandbox config: %w","messagePattern":"ensure codex sandbox config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/codex_home.go","lineNumber":298,"sourceCode":"\t// rationale. On Windows, resolve the native-sandbox state across the copied\n\t// config and the effective custom args so an explicit user opt-in is honored\n\t// and an undecidable config fails closed instead of loosening.\n\tconfigFile := filepath.Join(codexHome, \"config.toml\")\n\twinState := windowsSandboxAbsent\n\tif resolveGOOS(opts.GOOS) == \"windows\" {\n\t\twinState = resolveWindowsSandboxState(configFile, configSyncErr, statSharedCodexConfig(sharedHome), opts.CodexCustomArgs, logger)\n\t}\n\tpolicy := codexSandboxPolicyForConfig(opts.GOOS, opts.CodexVersion, winState)\n\tif err := ensureCodexSandboxConfig(configFile, policy, opts.CodexVersion, logger); err != nil {\n\t\t// The managed block is the authoritative on-disk sandbox policy. If it\n\t\t// can't be written, config.toml keeps whatever it already had — on a\n\t\t// reused home that may be a stale danger-full-access from a prior run —\n\t\t// so the fail-closed policy just computed above would only exist in\n\t\t// memory while the effective config silently stays loose. Abort rather\n\t\t// than launch Codex with an unenforced sandbox: on fresh Prepare this\n\t\t// fails the task; on Reuse the caller leaves env.CodexHome unset, which\n\t\t// configureCodexTaskShellEnvironment then refuses to start (MUL-4957).\n\t\treturn fmt.Errorf(\"ensure codex sandbox config: %w\", err)\n\t}\n\n\t// Disable Codex native multi-agent inside daemon-managed task sessions\n\t// so the parent thread's `turn/completed` is not interpreted as task\n\t// completion while spawned subagents are still running. See\n\t// codex_multi_agent.go for the full rationale and escape hatch.\n\tif err := ensureCodexMultiAgentConfig(filepath.Join(codexHome, \"config.toml\"), logger); err != nil {\n\t\tlogger.Warn(\"execenv: codex-home ensure multi-agent config failed\", \"error\", err)\n\t}\n\n\t// Disable Codex native auto-memory inside daemon-managed task sessions\n\t// so cross-task and cross-workspace context leaks (multica#3130) cannot\n\t// happen via `codex-home/memories/` or `~/.codex/memories/`. See\n\t// codex_memory.go for the full rationale and escape hatch.\n\tif err := ensureCodexMemoryConfig(filepath.Join(codexHome, \"config.toml\"), logger); err != nil {\n\t\tlogger.Warn(\"execenv: codex-home ensure memory config failed\", \"error\", err)\n\t}\n","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/codex_home.go#L280-L316","documentation":"Error \"ensure codex sandbox config: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/codex_home.go:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions for the codex sandbox config location."],"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"}