Yeachan-Heo/oh-my-codex · error · Error
Missing notification metadata snapshot for ${notifyPlan.meta
Error message
Missing notification metadata snapshot for ${notifyPlan.metadataPath}; refusing to plan from a newly captured baseline. What it means
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.
Source
Thrown at src/cli/setup.ts:3874
modelUpgrade = {
currentModel: managedConfigPlan.currentModel,
modelOverride: managedConfigPlan.modelOverride,
};
}
repairedLegacyTeamRunTable = managedConfigPlan.repairedLegacyTeamRunTable;
const notifyPlan = managedConfigPlan.notifyPlan;
if (notifyPlan.metadataSnapshot && notifyPlan.metadataPath) {
notifyMetadataPrecondition = nativeHookTransactionPrecondition(
"metadata",
notifyPlan.metadataPath,
`notification metadata ${notifyPlan.metadataPath}`,
notifyPlan.metadataSnapshot,
);
}
if (notifyPlan.metadataPath && notifyPlan.metadata) {
const metadataBefore = options.notifyMetadataSnapshot;
if (!metadataBefore) {
throw new Error(
`Missing notification metadata snapshot for ${notifyPlan.metadataPath}; refusing to plan from a newly captured baseline.`,
);
}
notifyMetadataArtifact = nativeHookTransactionArtifact(
"metadata",
notifyPlan.metadataPath,
`notification metadata ${notifyPlan.metadataPath}`,
metadataBefore,
Buffer.from(JSON.stringify(notifyPlan.metadata, null, 2) + "\n", "utf-8"),
);
if (!notifyMetadataPrecondition) {
notifyMetadataPrecondition = nativeHookTransactionPrecondition(
"metadata",
notifyPlan.metadataPath,
`notification metadata ${notifyPlan.metadataPath}`,
metadataBefore,
);
}View on GitHub (pinned to 3ad79a8a6f)
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
Defensive patterns
Strategy: try-catch
Try / catch
catch (e) { if (String(e).includes('refusing to plan from a newly captured baseline')) { throw new Error('Setup planner bug: capture metadata snapshot first'); } } Prevention
- 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
When it happens
Trigger: Calling the setup planner with options.notifyMetadataSnapshot undefined while notifyPlan.metadataPath and notifyPlan.metadata are set (i.e. a metadata write/overwrite is planned).
Common situations: Internal caller regression, or invoking the setup planning API directly without first capturing the existing metadata file snapshot via captureNativeHookTransactionArtifact.
Related errors
- Native hook transaction wrote invalid hooks.json: ${validati
- invalid_document
- Missing notification metadata snapshot for ${metadataPath};
- formatCodexGoalReconciliation(reconciliation)
- Blocked ultragoal checkpoint Codex snapshot is missing objec
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/038c72d017b7c8ff.
Report an issue: GitHub.