{"record":{"id":"2cf52617f78d4d43","repo":"Yeachan-Heo/oh-my-codex","slug":"approved-execution-binding-malformed-sanitized","errorCode":null,"errorMessage":"approved_execution_binding_malformed:${sanitized}","messagePattern":"approved_execution_binding_malformed:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":5633,"sourceCode":"  return { commitHygieneArtifacts }\n}\n\n/**\n * Resume monitoring an existing team.\n */\nexport async function resumeTeam(teamName: string, cwd: string): Promise<TeamRuntime | null> {\n  const sanitized = resolveTeamNameForCurrentContext(teamName, cwd);\n  const config = await readTeamConfig(sanitized, cwd);\n  if (!config) return null;\n  config.lifecycle_profile = 'default';\n  const leaderCwd = config.leader_cwd ?? cwd;\n  const approvedExecutionState = await resolvePersistedApprovedTeamExecutionContinuityState(\n    sanitized,\n    leaderCwd,\n    config.team_state_root ?? resolveCanonicalTeamStateRoot(leaderCwd),\n  );\n  if (approvedExecutionState.status === 'malformed') {\n    throw new Error(`approved_execution_binding_malformed:${sanitized}`);\n  }\n  if (approvedExecutionState.status === 'ambiguous') {\n    throw new Error(\n      `approved_execution_binding_ambiguous:${approvedExecutionState.binding.prd_path}:${approvedExecutionState.binding.task}`,\n    );\n  }\n  if (approvedExecutionState.status === 'stale') {\n    throw new Error(\n      `approved_execution_binding_stale:${approvedExecutionState.binding.prd_path}:${approvedExecutionState.binding.task}`,\n    );\n  }\n  if (config.worker_launch_mode === 'prompt') {\n    const handleTeamConfig = { ...config, name: sanitized };\n    const hasLivePromptWorker = config.workers.some((worker) => isPromptWorkerAlive(handleTeamConfig, worker));\n    if (!hasLivePromptWorker) return null;\n\n    const missingHandles = config.workers\n      .filter((worker) => {","sourceCodeStart":5615,"sourceCodeEnd":5651,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5615-L5651","documentation":"Thrown when resolving the persisted approved team execution continuity state returns status 'malformed' — the saved approved-execution binding cannot be parsed or is invalid.","triggerScenarios":"Calling resume/continuity APIs for a team whose persisted approved execution state file is corrupt, truncated, or fails schema validation.","commonSituations":"Manually edited or partially written team state JSON, version upgrades that changed the binding schema, or crashes while persisting the binding.","solutions":["Inspect the persisted approved-execution state file under the team state root for corruption","Delete or re-create the approved execution binding via the normal approve flow","If caused by an upgrade, re-run the approval step to regenerate state in the new format"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const state = await resolvePersistedApprovedTeamExecutionContinuityState(name, cwd, root); if (state.status === 'malformed') { /* reset binding */ }","typeGuard":"(s): s is { status: 'ok' } => s.status === 'ok'","tryCatchPattern":null,"preventionTips":["Validate persisted state after crashes","Never hand-edit team state JSON"],"tags":["team","state","persistence","validation"],"backgroundTag":"corrupt-state-file","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}