Repository navigation
Replies: 1 comment
|
这条也成立,而且我能补上你没解释的那个不对称:为什么同样是 5xx 级故障,一条走重试、另一条不走。 1. 那一行就是问题所在
if (/\b5\d\d\b/.test(message)) return 'SERVER'
我把前面几个分支逐条核了一遍,确认不会误吞
2. ⭐ 那个不对称的原因:两条 pi-ai 路线生成的字符串形状不同你注意到"同一会话里 503 走重试、文本
⇒ 所以"同一个 5xx 级故障,分类结果不同"不是随机的,而是由 pi-ai 用哪条路线格式化错误决定的。这一条建议写进报告 —— 它把一个看起来像巧合的现象变成了确定机制。 (我拉了 3. 一处措辞要收窄你写 "the upstream source still contains the numeric-5xx-only classifier" —— ⇒ 建议改成" 4. 你的克制是对的,我确认一遍你明确说不要图省事把 分支顺序必须保持在其后( 5. 建议与 #9508 合并成一份通用修法你的 既然 pi-ai 生成的形状是 ⇒ 建议把两帖合成一份修法:解析 6. 版本你标 7. 一条边界你本机的 8. 一个可以直接引用的旁证
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
This remains reproducible on current
master(d743267388641bc76f17c45ce8b4c231aed1d32c, package version0.2.1-alpha.2) as of 2026-10-12.An OpenAI Responses-compatible provider can return a terminal error such as:
@deepseek-ai/dsh-llm-pi-aiclassifies it asPI_AI_ERROR, so the normal retry policy does not retry it. This is a fresh current-master verification of the issue previously reported in #3407; the upstream source still contains the numeric-5xx-only classifier.Runtime evidence
A real Desktop session showed both paths in the same session:
503failures entered the configured retry path;server_errorfailure ended the turn immediately asPI_AI_ERROR, with nollm/retryorllm/retry-startedevent for that failure.This rules out a missing retry plugin or exhausted global retry mechanism. The classification result is the deciding difference.
Root cause
Current
classifyPiAiError()recognizes numeric 5xx text only:The provider's stable
server_errormarker carries no HTTP status, falls through toPI_AI_ERROR, and is therefore excluded from the default retryable set (EMPTY_RESPONSE,RATE_LIMIT,SERVER,TIMEOUT,TRANSPORT).Minimal fix
The branch order should stay unchanged so authentication, quota, rate-limit, and invalid-request classifications keep precedence.
This is intentionally narrower than adding
PI_AI_ERRORtoretryableCodes: terminalpending,deferred, and unknown permanent provider failures should remain non-retryable. The patch preserves the original message and lets the existing bounded retry policy handle only the newly recognized server failure.Regression coverage added locally
mapStopReason()cases cover the complete error text and bareserver_error, asserting bothSERVERand exact message preservation.response.failedevent with{ code: "server_error" }throughLlmPiAiand assertsSERVER.server-error-retrysession snapshot recordsSERVER → llm/retry → llm/retry-started → completed.All three new assertions fail against the unmodified classifier (
PI_AI_ERROR) and pass after the one-line mapping change.Validation
pnpm run test:docs: 21 passed, 0 failed;pnpm run doc-sync: 43 passed, 0 failed;git diff --check: passed.The local change also updates the pi-ai English/Chinese package README and translation-pairing record. It remains uncommitted and unpushed.
Suggested upstream action
Please land the narrow
server_error → SERVERmapping and the adapter/session regressions. Longer term, preserving the provider's structured error code/status through pi-ai into DSH would remove the need to infer transient classes from display text.All reactions