{"record":{"id":"514e8e4b584ddf15","repo":"multica-ai/multica","slug":"write-config-toml-w","errorCode":null,"errorMessage":"write config.toml: %w","messagePattern":"write config\\.toml: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/codex_sandbox.go","lineNumber":475,"sourceCode":"\n\tif policy.Mode == \"danger-full-access\" && logger != nil {\n\t\tversion := detectedVersion\n\t\tif version == \"\" {\n\t\t\tversion = \"unknown\"\n\t\t}\n\t\tattrs := []any{\n\t\t\t\"reason\", policy.Reason,\n\t\t\t\"codex_version\", version,\n\t\t\t\"config_path\", configPath,\n\t\t}\n\t\tif policy.Hint != \"\" {\n\t\t\tattrs = append(attrs, \"hint\", policy.Hint)\n\t\t}\n\t\tlogger.Warn(\"codex sandbox: running unsandboxed with danger-full-access\", attrs...)\n\t}\n\n\tif err := os.WriteFile(configPath, []byte(updated), 0o644); err != nil {\n\t\treturn fmt.Errorf(\"write config.toml: %w\", err)\n\t}\n\treturn nil\n}\n\n// --- small semver helper, scoped to this package to avoid an import cycle\n// with server/pkg/agent. The agent package already has a similar parser; we\n// duplicate the minimal bits here because execenv cannot depend on agent.\n\ntype codexSemver struct {\n\tMajor, Minor, Patch int\n}\n\nvar codexSemverRe = regexp.MustCompile(`v?(\\d+)\\.(\\d+)\\.(\\d+)`)\n\nfunc parseCodexSemver(raw string) (codexSemver, error) {\n\tm := codexSemverRe.FindStringSubmatch(raw)\n\tif m == nil {\n\t\treturn codexSemver{}, fmt.Errorf(\"cannot parse version %q\", raw)","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/codex_sandbox.go#L457-L493","documentation":"After rendering the updated config with the multica-managed sandbox block, os.WriteFile to config.toml failed. The sandbox policy (including any danger-full-access fallback) could not be persisted, so the task does not start with the intended sandbox config.","triggerScenarios":"Task home or config.toml directory not writable; ENOSPC; the file is held open with mandatory locks on Windows.","commonSituations":"Full disk; permission drift in a reused task home; antivirus/locking software on Windows interfering.","solutions":["Free disk space on the task home volume","Verify the daemon user has write access to the config.toml path","Remove any process locking the file and retry prepare"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := os.WriteFile(configPath+\".probe\", []byte{}, 0o644); err != nil {\n\treturn fmt.Errorf(\"config path not writable: %w\", err)\n}\nos.Remove(configPath + \".probe\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check free space and write permissions before task start","Exclude task homes from antivirus/locking scans on Windows"],"tags":["filesystem","config","codex","sandbox"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}