Repository navigation
Replies: 2 comments 1 reply
|
Follow-up on the root cause, and a simpler fix than the two regexes above. Why text matching at all: these failures arrive mid-stream (WebSocket open or SSE already 200), so there is no HTTP status or Suggested fix: pi-ai already exports that outer-loop classifier, case 'error': {
const text = message.errorMessage ?? 'pi-ai stream error'
const code = classifyPiAiError(text)
return { kind: 'error', failure: { message: text, code: code === 'PI_AI_ERROR' && isRetryableAssistantError(message) ? 'SERVER' : code } }
} |
|
你的诊断逐条成立,而且你那条 follow-up 已经找到了比自建正则更好的路。我把链路上每一环的行号补齐,并给你一个决定性的版本事实:你建议的那个导出,在仓库现有的依赖范围内今天就能用,不需要改 manifest。 1. 分类函数:你的三处断言逐行核实
同函数里已有的近亲分支供你对照: 2. 重试闸门:
|
Uh oh!
There was an error while loading. Please reload this page.
Version: @deepseek-ai/dsh 0.2.0-rc.2 (same code on main,
packages/llm/llm-pi-ai/src/stream.ts,classifyPiAiError).What happens: on the
openai-codexroute, Codex reports server-side outages as in-stream error events, with no HTTP status in the text.classifyPiAiErrorfalls through toPI_AI_ERROR, which is not in the defaultretryableCodes, so the turn ends instead of being retried. Messages seen in our session logs over four days (24 failed turns, all at step start with zero output tokens, several sessions failing in the same minute):Codex error: An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists.(16)Codex error: Our servers are currently overloaded. Please try again later.(4)WebSocket closed 1000(3)WebSocket error(1)The
/\b5\d\d\b/test never matches these, and\bsocket\bdoes not matchWebSocket(no word boundary beforesocket), while the existingWebSocket closed unexpectedlypattern does not coverWebSocket closed 1000.Suggested fix (in
classifyPiAiError, before the final fallback):Workaround: per-route
retryPolicy.retryableCodesincludingPI_AI_ERRORonopenai-codex. It works, but it also retries non-transientPI_AI_ERRORs (content-policy refusals,pending/deferred).All reactions