{"record":{"id":"0f74526ed61a67e2","repo":"Yeachan-Heo/oh-my-codex","slug":"refusing-malformed-active-skills-entry-index-in","errorCode":null,"errorMessage":"Refusing malformed active_skills entry ${index} in ${path}.","messagePattern":"Refusing malformed active_skills entry (.+?) in (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":8332,"sourceCode":"      throw new Error(`Refusing contradictory owner_codex_session_id in ${path}.`);\n    }\n  }\n}\n\n\nfunction assertCompatibleNestedSkillOwners(\n  value: Record<string, unknown>,\n  authority: ExactSessionCancellationAuthority,\n  path: string,\n): void {\n  if (!Object.prototype.hasOwnProperty.call(value, \"active_skills\")) return;\n  if (!Array.isArray(value.active_skills)) {\n    throw new Error(`Refusing malformed active_skills in ${path}.`);\n  }\n  for (const [index, skill] of value.active_skills.entries()) {\n    const entryPath = `${path} active_skills[${index}]`;\n    if (!skill || typeof skill !== \"object\" || Array.isArray(skill)) {\n      throw new Error(`Refusing malformed active_skills entry ${index} in ${path}.`);\n    }\n    const entry = skill as Record<string, unknown>;\n    if (typeof entry.skill !== \"string\" || entry.skill.trim() === \"\") {\n      throw new Error(`Refusing malformed skill in ${entryPath}.`);\n    }\n    for (const field of [\"active\"] as const) {\n      if (Object.prototype.hasOwnProperty.call(entry, field) && typeof entry[field] !== \"boolean\") {\n        throw new Error(`Refusing malformed ${field} in ${entryPath}.`);\n      }\n    }\n    if (Object.prototype.hasOwnProperty.call(entry, \"phase\") && typeof entry.phase !== \"string\") {\n      throw new Error(`Refusing malformed phase in ${entryPath}.`);\n    }\n    for (const [field, fieldValue] of Object.entries(entry)) {\n      if (field.endsWith(\"_at\") && typeof fieldValue !== \"string\") {\n        throw new Error(`Refusing malformed ${field} in ${entryPath}.`);\n      }\n    }","sourceCodeStart":8314,"sourceCodeEnd":8350,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L8314-L8350","documentation":"Thrown while validating each element of active_skills when an entry is not a plain object (null, a primitive, or an array). The validator iterates the array and requires every entry to be an object-shaped record before reading its fields. This guards against cancellation logic dereferencing non-object entries.","triggerScenarios":"A state file where active_skills contains null, a string, a number, or a nested array, e.g. {\"active_skills\": [null]} or {\"active_skills\": [\"deploy\"]}. The cancel command throws as soon as it reaches that entry.","commonSituations":"Truncated JSON from an interrupted write; state produced by a different schema version; manual edits that replaced an entry with a scalar; third-party tooling writing simplified skill lists.","solutions":["Open the state file from ${path} and find the entry at the reported index","Replace the malformed entry with an object like {\"skill\": \"name\"} or delete it","Re-run the cancel command","If entries are systematically wrong, regenerate the state file with the command that owns it"],"exampleFix":"// before\n\"active_skills\": [\"deploy\"]\n// after\n\"active_skills\": [{ \"skill\": \"deploy\", \"active\": true }]","handlingStrategy":"validation","validationCode":"function activeSkillEntriesOk(v: unknown): boolean {\n  const arr = (v as { active_skills?: unknown[] })?.active_skills;\n  return !arr || arr.every((e) => !!e && typeof e === \"object\" && !Array.isArray(e));\n}","typeGuard":"function isSkillEntry(v: unknown): v is Record<string, unknown> {\n  return !!v && typeof v === \"object\" && !Array.isArray(v);\n}","tryCatchPattern":null,"preventionTips":["Write active_skills entries only as objects","Regenerate state with the owning command after schema changes","Avoid mixing tool versions on the same state directory"],"tags":["state-validation","cli","corrupt-state","cancel"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}