{"record":{"id":"6d439abd7b3194b1","repo":"earendil-works/pi","slug":"output-errormessage-an-unknown-error-occurred-6d439a","errorCode":null,"errorMessage":"output.errorMessage || \"An unknown error occurred\"","messagePattern":"output\\.errorMessage \\|\\| \"An unknown error occurred\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/ai/src/api/openai-codex-responses.ts","lineNumber":108,"sourceCode":"\ttool_choice?: OpenAICodexResponsesOptions[\"toolChoice\"];\n\tparallel_tool_calls?: boolean;\n\ttemperature?: number;\n\treasoning?: { effort?: string; summary?: string };\n\tservice_tier?: ResponseCreateParamsStreaming[\"service_tier\"];\n\ttext?: { verbosity?: string };\n\tinclude?: string[];\n\tprompt_cache_key?: string;\n\t[key: string]: unknown;\n}\n\ntype SuccessfulAssistantMessage = AssistantMessage & { stopReason: \"stop\" | \"length\" | \"toolUse\" };\n\nfunction assertSuccessfulOutput(output: AssistantMessage): asserts output is SuccessfulAssistantMessage {\n\tif (output.stopReason === \"pending\") {\n\t\tthrow new Error(\"Codex stream ended without a stop reason\");\n\t}\n\tif (output.stopReason === \"error\" || output.stopReason === \"aborted\") {\n\t\tthrow new Error(output.errorMessage || \"An unknown error occurred\");\n\t}\n}\n\n// ============================================================================\n// Retry Helpers\n// ============================================================================\n\nfunction isTerminalRateLimitError(errorText: string): boolean {\n\treturn /GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(\n\t\terrorText,\n\t);\n}\n\nfunction isRetryableError(status: number, errorText: string): boolean {\n\tif (status === 429 && isTerminalRateLimitError(errorText)) {\n\t\treturn false;\n\t}\n\tif (status === 429 || status === 500 || status === 502 || status === 503 || status === 504) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/api/openai-codex-responses.ts#L90-L126","documentation":"Error \"output.errorMessage || \"An unknown error occurred\"\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/api/openai-codex-responses.ts:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect output.errorMessage for the provider error detail."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}