{"record":{"id":"038c72d017b7c8ff","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-notification-metadata-snapshot-for-notif","errorCode":null,"errorMessage":"Missing notification metadata snapshot for ${notifyPlan.metadataPath}; refusing to plan from a newly captured baseline.","messagePattern":"Missing notification metadata snapshot for (.+?); refusing to plan from a newly captured baseline\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/setup.ts","lineNumber":3874,"sourceCode":"\t\t\tmodelUpgrade = {\n\t\t\t\tcurrentModel: managedConfigPlan.currentModel,\n\t\t\t\tmodelOverride: managedConfigPlan.modelOverride,\n\t\t\t};\n\t\t}\n\t\trepairedLegacyTeamRunTable = managedConfigPlan.repairedLegacyTeamRunTable;\n\t\tconst notifyPlan = managedConfigPlan.notifyPlan;\n\t\tif (notifyPlan.metadataSnapshot && notifyPlan.metadataPath) {\n\t\t\tnotifyMetadataPrecondition = nativeHookTransactionPrecondition(\n\t\t\t\t\"metadata\",\n\t\t\t\tnotifyPlan.metadataPath,\n\t\t\t\t`notification metadata ${notifyPlan.metadataPath}`,\n\t\t\t\tnotifyPlan.metadataSnapshot,\n\t\t\t);\n\t\t}\n\t\tif (notifyPlan.metadataPath && notifyPlan.metadata) {\n\t\t\tconst metadataBefore = options.notifyMetadataSnapshot;\n\t\t\tif (!metadataBefore) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Missing notification metadata snapshot for ${notifyPlan.metadataPath}; refusing to plan from a newly captured baseline.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tnotifyMetadataArtifact = nativeHookTransactionArtifact(\n\t\t\t\t\"metadata\",\n\t\t\t\tnotifyPlan.metadataPath,\n\t\t\t\t`notification metadata ${notifyPlan.metadataPath}`,\n\t\t\t\tmetadataBefore,\n\t\t\t\tBuffer.from(JSON.stringify(notifyPlan.metadata, null, 2) + \"\\n\", \"utf-8\"),\n\t\t\t);\n\t\t\tif (!notifyMetadataPrecondition) {\n\t\t\t\tnotifyMetadataPrecondition = nativeHookTransactionPrecondition(\n\t\t\t\t\t\"metadata\",\n\t\t\t\t\tnotifyPlan.metadataPath,\n\t\t\t\t\t`notification metadata ${notifyPlan.metadataPath}`,\n\t\t\t\t\tmetadataBefore,\n\t\t\t\t);\n\t\t\t}","sourceCodeStart":3856,"sourceCodeEnd":3892,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/setup.ts#L3856-L3892","documentation":"While building the enable/setup transaction: the plan includes a notify metadata change, but no pre-change snapshot of that file was supplied by the caller. Refusing to plan from a newly captured baseline guards against clobbering an existing metadata file without a backup.","triggerScenarios":"Calling the setup planner with options.notifyMetadataSnapshot undefined while notifyPlan.metadataPath and notifyPlan.metadata are set (i.e. a metadata write/overwrite is planned).","commonSituations":"Internal caller regression, or invoking the setup planning API directly without first capturing the existing metadata file snapshot via captureNativeHookTransactionArtifact.","solutions":["Capture the metadata file snapshot (captureNativeHookTransactionArtifact) before planning and pass it as options.notifyMetadataSnapshot","If you're an end user, update OMX — this indicates a planner invocation bug, not a config problem"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).includes('refusing to plan from a newly captured baseline')) { throw new Error('Setup planner bug: capture metadata snapshot first'); } }","preventionTips":["Library callers must always capture file snapshots before planning transactions","Update OMX if hitting this as an end user — it signals an internal invocation bug"],"tags":["codex","hooks","transaction","snapshot","internal-invariant"],"backgroundTag":"missing-transaction-snapshot","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}