{"record":{"id":"e0d7b57230421287","repo":"thedotmack/claude-mem","slug":"invalid-override-file-overrideid-using-parent","errorCode":null,"errorMessage":"Invalid override file: ${overrideId}, using parent mode '${parentId}' only","messagePattern":"Invalid override file: (.+?), using parent mode '(.+?)' only","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/domain/ModeManager.ts","lineNumber":157,"sourceCode":"      parentMode = this.loadMode('code');\n    }\n\n    let overrideConfig: Partial<ModeConfig>;\n    try {\n      overrideConfig = this.loadModeFile(overrideId);\n      logger.debug('SYSTEM', `Loaded override file: ${overrideId} for parent ${parentId}`);\n    } catch (error) {\n      if (error instanceof Error) {\n        logger.warn('WORKER', `Override file '${overrideId}' not found, using parent mode '${parentId}' only`, { message: error.message });\n      } else {\n        logger.warn('WORKER', `Override file '${overrideId}' not found, using parent mode '${parentId}' only`, { error: String(error) });\n      }\n      this.activeMode = parentMode;\n      return parentMode;\n    }\n\n    if (!overrideConfig) {\n      logger.warn('SYSTEM', `Invalid override file: ${overrideId}, using parent mode '${parentId}' only`);\n      this.activeMode = parentMode;\n      return parentMode;\n    }\n\n    const mergedMode = this.deepMerge(parentMode, overrideConfig);\n    this.activeMode = mergedMode;\n    this.activeModeId = modeId;\n\n    logger.debug('SYSTEM', `Loaded mode with inheritance: ${mergedMode.name} (${modeId} = ${parentId} + ${overrideId})`, undefined, {\n      parent: parentId,\n      override: overrideId,\n      types: mergedMode.observation_types.map(t => t.id),\n      concepts: mergedMode.observation_concepts.map(c => c.id)\n    });\n\n    return mergedMode;\n  }\n","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/domain/ModeManager.ts#L139-L175","documentation":"loadModeFile(overrideId) can return without throwing yet produce a falsy value — typically an empty or unusable document. This warning catches that case and again falls back to the parent mode only. It differs from the 'not found' warnings: the file was reachable and did not fail a parse, but it evaluated to nothing usable as a ModeConfig.","triggerScenarios":"The override file exists and reads fine but is empty (0 bytes), whitespace-only, or its content maps to null/undefined in the loader (e.g. an empty document the loader normalizes away).","commonSituations":"Empty override file left by an editor 'new file' action; template never filled in; file truncated to zero bytes by a disk-full condition during an earlier save; misnamed empty placeholder.","solutions":["Open the override file and confirm it contains a non-empty, valid config document.","If emptiness was intentional, delete the file and remove the inheritance.overrideId reference instead of keeping an empty file.","Write minimal valid content (an object with the keys you mean to override) and re-activate the mode.","Recognize this specific message: it means the file was read but evaluated falsy — not a read or parse exception."],"exampleFix":"// override file my-override.json — before (empty)\n\n// after (minimal valid override)\n{ \"name\": \"code + my tweaks\" }","handlingStrategy":"validation","validationCode":"// reject empty override documents before they reach ModeManager\nconst raw = readFileSync(overridePath, 'utf-8').trim();\nif (raw.length === 0) throw new Error(`override file is empty: ${overridePath}`);\nconst parsed: unknown = JSON.parse(raw);","typeGuard":"function isUsableOverrideDoc(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && Object.keys(v).length > 0;\n}","tryCatchPattern":null,"preventionTips":["Never commit empty override files; delete them and drop the reference instead.","Assert parsed override documents are non-empty objects in mode-pack tests."],"tags":["mode-config","override","empty-file","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}