{"record":{"id":"f14d99b74c3b4e23","repo":"Yeachan-Heo/oh-my-codex","slug":"blocked-ultragoal-checkpoint-objective-mismatch-e","errorCode":null,"errorMessage":"Blocked ultragoal checkpoint objective mismatch: expected one of [${[expectedCodexObjective(plan, goal), ...compatibleCodexObjectives(plan)].join(' | ')}], got ${snapshot.objective}. Matching native blocked checkpoints require the expected/compatible Codex objective; finish or clear the foreign goal, or pass a matching blocked get_goal snapshot with --evidence.","messagePattern":"Blocked ultragoal checkpoint objective mismatch: expected one of \\[(.+?)\\], got (.+?)\\. Matching native blocked checkpoints require the expected/compatible Codex objective; finish or clear the foreign goal, or pass a matching blocked get_goal snapshot with --evidence\\.","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/ultragoal/artifacts.ts","lineNumber":1826,"sourceCode":"        status: goal.status,\n        evidence: options.evidence,\n        codexGoal: options.codexGoal,\n        message: 'Codex get_goal was unavailable due to a DB/schema/context error; strict completion reconciliation is deferred until get_goal works.',\n      });\n      return plan;\n    }\n    if (!snapshot?.available) {\n      throw new UltragoalError('Blocked ultragoal checkpoints require either a get_goal snapshot for the completed legacy Codex goal that blocked create_goal, an unavailable get_goal error JSON for a Codex DB/schema/context failure, or a matching native blocked snapshot; pass --codex-goal-json.');\n    }\n    if (!snapshot.objective) {\n      throw new UltragoalError('Blocked ultragoal checkpoint Codex snapshot is missing objective text.');\n    }\n    const blockedSnapshotMatchesExpected = [expectedCodexObjective(plan, goal), ...compatibleCodexObjectives(plan)]\n      .some((objective) => normalizeObjective(objective) === normalizeObjective(snapshot.objective ?? ''));\n    if (snapshot.status === 'blocked') {\n      if (!blockedSnapshotMatchesExpected) {\n        throw new UltragoalError(\n          `Blocked ultragoal checkpoint objective mismatch: expected one of [${[expectedCodexObjective(plan, goal), ...compatibleCodexObjectives(plan)].join(' | ')}], got ${snapshot.objective}. Matching native blocked checkpoints require the expected/compatible Codex objective; finish or clear the foreign goal, or pass a matching blocked get_goal snapshot with --evidence.`,\n        );\n      }\n      const evidence = assertNonEmpty(options.evidence, '--evidence');\n      goal.updatedAt = now;\n      plan.activeGoalId = goal.id;\n      plan.updatedAt = now;\n      await writePlan(cwd, plan);\n      await appendLedger(cwd, {\n        ts: now,\n        event: 'goal_blocked',\n        goalId: goal.id,\n        status: goal.status,\n        evidence,\n        codexGoal: options.codexGoal,\n        message: 'Native Codex goal status is blocked for the matching objective; recorded a non-terminal goal_blocked checkpoint. Continue work without treating this as complete or failed; re-check get_goal when the blocker clears.',\n      });\n      return plan;\n    }","sourceCodeStart":1808,"sourceCodeEnd":1844,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/ultragoal/artifacts.ts#L1808-L1844","documentation":"The blocked get_goal snapshot's objective does not match the plan's expected Codex objective or any compatible objective. A 'blocked' snapshot status only permits a native blocked checkpoint when it matches this goal; foreign goals must be finished or cleared first.","triggerScenarios":"Passing a blocked snapshot whose normalized objective differs from normalizeObjective(expectedCodexObjective(plan, goal)) and all compatibleCodexObjectives(plan) — i.e. the blocked Codex goal belongs to different work.","commonSituations":"Leftover Codex goals from previous tasks blocking create_goal; multiple concurrent objectives in one Codex workspace; objective text drift between plan and Codex goal.","solutions":["Finish or clear the foreign Codex goal in Codex, then retry","Pass a get_goal snapshot for the goal whose objective matches the plan (check compatible objectives in the error message)","Align the plan's expected objective text with the actual Codex goal objective if they describe the same work"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const allowed = [expectedCodexObjective(plan, goal), ...compatibleCodexObjectives(plan)].map(normalizeObjective);\nif (!allowed.includes(normalizeObjective(snap.objective ?? ''))) { /* finish/clear foreign goal first */ }","typeGuard":"const objectiveMatches = (snap: any, plan: any, goal: any) =>\n  [expectedCodexObjective(plan, goal), ...compatibleCodexObjectives(plan)]\n    .some(o => normalizeObjective(o) === normalizeObjective(snap.objective ?? ''));","tryCatchPattern":null,"preventionTips":["Keep plan objective text and Codex goal objective in sync","Clean up leftover Codex goals before starting new ultragoals"],"tags":["ultragoal","codex","objective-mismatch","blocked"],"backgroundTag":"objective-mismatch","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}