{"record":{"id":"cfff584b0abdb511","repo":"Yeachan-Heo/oh-my-codex","slug":"status-must-be-one-of-open-pending-prompting-an","errorCode":null,"errorMessage":"status must be one of open, pending, prompting, answered, aborted, error","messagePattern":"status must be one of open, pending, prompting, answered, aborted, error","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mcp/hermes-bridge.ts","lineNumber":390,"sourceCode":"): Promise<HermesBridgeResult<{ events: Awaited<ReturnType<typeof readQuestionEvents>> }>> {\n  try {\n    const cwd = resolveWorkingDirectoryForState(normalizeString(args.workingDirectory, \"workingDirectory\"));\n    const limit = normalizePositiveInteger(args.limit, 100, 1000);\n    return jsonResult({ events: await readQuestionEvents(cwd, { limit }) });\n  } catch (error) {\n    return failure(\"invalid_input\", error instanceof Error ? error.message : String(error));\n  }\n}\n\nexport async function hermesListQuestions(\n  args: Record<string, unknown>,\n): Promise<HermesBridgeResult<{ questions: HermesQuestionSummary[] }>> {\n  try {\n    const cwd = resolveWorkingDirectoryForState(normalizeString(args.workingDirectory, \"workingDirectory\"));\n    const sessionId = validateSessionId(normalizeString(args.session_id, \"session_id\"));\n    const status = normalizeString(args.status, \"status\") ?? \"open\";\n    if (![\"open\", \"pending\", \"prompting\", \"answered\", \"aborted\", \"error\"].includes(status)) {\n      throw new Error(\"status must be one of open, pending, prompting, answered, aborted, error\");\n    }\n    const limit = normalizePositiveInteger(args.limit, 100, 1000);\n    const questionStatus = status as \"open\" | QuestionRecord[\"status\"];\n    const records = await listQuestionRecords(cwd, {\n      ...(sessionId ? { sessionId } : {}),\n      status: questionStatus,\n      limit,\n    });\n    return jsonResult({ questions: records.map(({ record }) => projectQuestion(record)) });\n  } catch (error) {\n    return failure(\"invalid_input\", error instanceof Error ? error.message : String(error));\n  }\n}\n\nexport async function hermesSubmitQuestionAnswer(\n  args: Record<string, unknown>,\n  deps: { injectAnswersToPane?: InjectQuestionAnswersToPane } = {},\n): Promise<HermesBridgeResult<{ question: HermesQuestionSummary; answers: QuestionAnswerEntry[] }>> {","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/mcp/hermes-bridge.ts#L372-L408","documentation":"hermesListQuestions filters questions by status; the optional status argument must be one of open, pending, prompting, answered, aborted, or error. Any other string is rejected before querying records.","triggerScenarios":"Calling hermesListQuestions with status: 'resolved', 'OPEN' (case-sensitive check), or 'in_progress' — the allow-list check is exact and case-sensitive, defaulting to 'open' only when omitted.","commonSituations":"Clients guessing status names, casing mistakes, or statuses renamed between versions.","solutions":["Use one of the six exact statuses, lowercase","Omit status to default to 'open'","Check the tool schema/docs for the accepted enum values"],"exampleFix":"// before\n{ status: \"resolved\" }\n// after\n{ status: \"answered\" }","handlingStrategy":"validation","validationCode":"const STATUSES = ['open','pending','prompting','answered','aborted','error'] as const;\nif (status && !STATUSES.includes(status)) status = 'open';","typeGuard":"function isQuestionStatus(s: string): s is typeof STATUSES[number] { return (STATUSES as readonly string[]).includes(s); }","tryCatchPattern":null,"preventionTips":["Derive enum values from a shared constant","Lowercase user input before validation","Omit status to use the 'open' default"],"tags":["mcp","hermes-bridge","enum-validation","questions"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}