{"record":{"id":"bac0abbf7a8b1cf0","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-notification-metadata-snapshot-for-metad","errorCode":null,"errorMessage":"Missing notification metadata snapshot for ${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":null,"httpStatus":null,"severity":"error","filePath":"src/cli/setup.ts","lineNumber":6237,"sourceCode":"\tconst metadataPath = getNotifyMetadataPath(codexHomeDir);\n\tconst dispatcherNotify = [\n\t\t\"node\",\n\t\tjoin(pkgRoot, \"dist\", \"scripts\", \"notify-dispatcher.js\"),\n\t\t\"--metadata\",\n\t\tmetadataPath,\n\t];\n\tconst existingNotify = getRootTomlArray(existingConfig, \"notify\");\n\n\tif (!existingNotify) {\n\t\treturn { notifyCommand: omxNotify };\n\t}\n\n\tif (isOmxManagedNotifyCommand(existingNotify, pkgRoot)) {\n\t\tif (!isOmxDispatcherNotifyCommand(existingNotify, pkgRoot)) {\n\t\t\treturn { notifyCommand: omxNotify };\n\t\t}\n\t\tif (!metadataSnapshot) {\n\t\t\tthrow new Error(\n\t\t\t\t`Missing notification metadata snapshot for ${metadataPath}; refusing to plan from a newly captured baseline.`,\n\t\t\t);\n\t\t}\n\t\tconst metadata = parseNotifyMetadataSnapshot(\n\t\t\tmetadataSnapshot,\n\t\t\t`notification metadata ${metadataPath}`,\n\t\t);\n\t\tconst previousNotify = metadata?.previousNotify;\n\t\tif (\n\t\t\tArray.isArray(previousNotify) &&\n\t\t\tpreviousNotify.every((item) => typeof item === \"string\")\n\t\t) {\n\t\t\tconst sanitizedPreviousNotify = sanitizePreviousNotifyCommand(\n\t\t\t\tpreviousNotify,\n\t\t\t\tpkgRoot,\n\t\t\t);\n\t\t\tif (!sanitizedPreviousNotify) {\n\t\t\t\treturn { notifyCommand: omxNotify, metadataPath, metadataSnapshot };","sourceCodeStart":6219,"sourceCodeEnd":6255,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/setup.ts#L6219-L6255","documentation":"Planning notify changes: existing notify is OMX-managed and matches the dispatcher, meaning removal should restore the pre-OMX value from metadata — but no metadata snapshot was supplied, and planning from a newly captured baseline would lose the previous notify value, so it throws.","triggerScenarios":"Calling the notify planner with metadataSnapshot undefined while existingNotify is the OMX dispatcher command (isOmxDispatcherNotifyCommand true).","commonSituations":"Metadata file missing/deleted while config.toml still has the OMX notify command, or invoking the planning API directly without first capturing the metadata snapshot.","solutions":["Capture the metadata file snapshot before planning and pass metadataSnapshot through","Run `omx setup` to regenerate metadata, then retry","Manually reset `notify` in config.toml to your desired command before planning"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { existsSync } from 'node:fs';\nif (isOmxNotify(existingNotify) && !existsSync(metadataPath)) { /* reset notify in config.toml manually or rerun setup */ }","typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).includes('refusing to plan from a newly captured baseline')) { /* capture metadata snapshot first or rerun setup */ } else throw e; }","preventionTips":["Library callers: always capture the metadata snapshot before planning notify changes","End users: rerun `omx setup` to restore missing metadata"],"tags":["codex","notify","metadata","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"}