{"record":{"id":"03554480ab39abf6","repo":"multica-ai/multica","slug":"sync-codex-models-cache-v-discard-unsafe-cache","errorCode":null,"errorMessage":"sync codex models cache: %v; discard unsafe cache: %w","messagePattern":"sync codex models cache: (.+?); discard unsafe cache: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/codex_home.go","lineNumber":268,"sourceCode":"\t// agent's active skills directly to `codex-home/skills/`, so the\n\t// user-level registry is redundant here. See codex_skill_strip.go.\n\tif err := sanitizeCopiedCodexConfig(filepath.Join(codexHome, \"config.toml\")); err != nil {\n\t\tlogger.Warn(\"execenv: codex-home sanitize config failed\", \"error\", err)\n\t}\n\n\tif err := syncCodexReferencedFiles(codexHome, sharedHome); err != nil {\n\t\treturn fmt.Errorf(\"sync codex config file references: %w\", err)\n\t}\n\n\t// Seed the shared model cache only for a fresh task home. On reuse, keep a\n\t// task-local cache that Codex may have refreshed, but only while the source\n\t// provider/catalog configuration is still the one that cache was bound to.\n\t// If binding fails, discard the optional cache so Codex refreshes it instead\n\t// of potentially using models from the wrong provider.\n\tif err := syncCodexModelsCache(codexHome, sharedHome, freshHome); err != nil {\n\t\tlogger.Warn(\"execenv: codex-home models cache sync failed; discarding cache\", \"error\", err)\n\t\tif removeErr := os.RemoveAll(filepath.Join(codexHome, codexModelsCacheFile)); removeErr != nil {\n\t\t\treturn fmt.Errorf(\"sync codex models cache: %v; discard unsafe cache: %w\", err, removeErr)\n\t\t}\n\t}\n\n\tif err := exposeSharedCodexPluginCache(codexHome, sharedHome); err != nil {\n\t\tlogger.Warn(\"execenv: codex-home plugin cache exposure failed\", \"error\", err)\n\t}\n\n\t// Write a daemon-managed sandbox block into config.toml. On macOS we may\n\t// need to fall back to danger-full-access because of openai/codex#10390,\n\t// and on Windows the daemon defaults to danger-full-access unless the user\n\t// opted into a native windows.sandbox; see codex_sandbox.go for the full\n\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)","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/codex_home.go#L250-L286","documentation":"Error \"sync codex models cache: %v; discard unsafe cache: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/codex_home.go:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the unsafe models cache so it can be regenerated."],"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"}