{"record":{"id":"c2d89aa536190df6","repo":"Yeachan-Heo/oh-my-codex","slug":"shutdown-confirm-issues-required-failed-gate-fai","errorCode":null,"errorMessage":"shutdown_confirm_issues_required:failed=${gate.failed}:rerun=omx team shutdown ${sanitized} --confirm-issues","messagePattern":"shutdown_confirm_issues_required:failed=(.+?):rerun=omx team shutdown (.+?) --confirm-issues","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/team/runtime.ts","lineNumber":4937,"sourceCode":"    : '';\n  const governance = resolveGovernancePolicy(\n    manifest?.governance,\n    manifest?.policy as Partial<TeamGovernance> | undefined,\n  );\n\n  const classification = await withTeamTaskMembershipBarrier(sanitized, cwd, async () => {\n    const current = await classifyShutdown({\n      teamName: sanitized,\n      cwd,\n      config: config!,\n      governance,\n      confirmIssues,\n    });\n    const { gate, requiresIssueConfirmation } = current;\n\n    if (!force && !gate.allowed) {\n      if (requiresIssueConfirmation) {\n        throw new Error(\n          `shutdown_confirm_issues_required:failed=${gate.failed}:rerun=omx team shutdown ${sanitized} --confirm-issues`,\n        );\n      }\n      throw new Error(\n        `shutdown_gate_blocked:pending=${gate.pending},blocked=${gate.blocked},in_progress=${gate.in_progress},failed=${gate.failed}`,\n      );\n    }\n\n    const now = new Date().toISOString();\n    const existingPhase = await readTeamPhaseState(sanitized, cwd);\n    const terminalReason = force ? 'forced_shutdown' : 'shutdown_gate_passed';\n    await writeTeamPhaseState(sanitized, {\n      current_phase: existingPhase?.current_phase ?? 'team-exec',\n      max_fix_attempts: existingPhase?.max_fix_attempts ?? 3,\n      current_fix_attempt: existingPhase?.current_fix_attempt ?? 0,\n      transitions: existingPhase?.transitions ?? [],\n      updated_at: now,\n      terminal_epoch: existingPhase?.terminal_epoch ?? now,","sourceCodeStart":4919,"sourceCodeEnd":4955,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L4919-L4955","documentation":"Shutdown gate refusal in issue-confirmation mode: the gate is not allowed, failed tasks exist, and the caller did not pass --confirm-issues or force. The message embeds the failed count and the exact rerun command with --confirm-issues.","triggerScenarios":"Calling shutdown without force while the shutdown gate finds failed tasks and requiresIssueConfirmation is true — the API demands explicit acknowledgement of failed issues before teardown.","commonSituations":"Shutting down a team where some tasks failed; operators scripting shutdown without accounting for the confirm-issues gate; governance configured to require issue confirmation on shutdown.","solutions":["Re-run the exact command in the message with --confirm-issues (e.g. `omx team shutdown <team> --confirm-issues`) to acknowledge failed tasks","Investigate and fix the failed tasks first, so the gate allows a normal shutdown","Use force only if destroying the team despite failures is intentional"],"exampleFix":"# before\nomx team shutdown myteam\n\n# after\nomx team shutdown myteam --confirm-issues","handlingStrategy":"validation","validationCode":"const { gate, requiresIssueConfirmation } = await evaluateShutdownGate(teamName, { confirmIssues: false });\nif (requiresIssueConfirmation && gate.failed > 0) throw new Error('pass --confirm-issues or fix failures');","typeGuard":null,"tryCatchPattern":"try { await shutdownTeam(t, cwd, { force: false }); } catch (e) { if (/^shutdown_confirm_issues_required:/.test((e as Error).message)) await shutdownTeam(t, cwd, { confirmIssues: true }); else throw e; }","preventionTips":["Triage failed tasks before shutdown","Automate --confirm-issues in pipelines that intentionally discard teams","Never default to force in production"],"tags":["shutdown","gate","confirmation"],"backgroundTag":"operation-requires-confirmation","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}