Repository navigation
[Bug] llm-pi-ai 将上游重试缓冲错误归为 PI_AI_ERROR,跳过自动重试 #9397
Replies: 2 comments
|
Confirmed at source on The chain, in order
Your message matches none of them: Note what the
That is the opposite classification for a message sharing two words with yours, which is why your warning against generalising ("don't match every buffer / request-too-large message") is the load-bearing part of the fix and not a footnote. Corroborated on pi-ai's side
The finding is wider than one phraseI compared pi-ai's retryable pattern list against the classifier (transcribed with a guard that each regex source appears verbatim in the upstream file — 20/20 hold). Counting only pattern sources that are pure literals (no regex metacharacter, so the comparison is exact):
The unplaceable set on the pinned line: Caveats on that table, stated so the numbers are not read as more than they are: a few entries are fragments rather than whole messages ( Why that is a bug and not a policyThe two halves are in the same repository and pull in opposite directions:
Recovery was deliberately moved off pi-ai's wording-driven retry and onto a name-driven policy — but the two sets are not the same set, and every wording above is a transient failure pi-ai would have retried and the harness will not. That is the argument against "the SDK just gave up": it was told to. Plugin-form remedy, for deployments that cannot change the dependencyThis family already has an asset: It does not cover your case, for two reasons worth separating:
So I am adding a third recognition to that package: To be clear about what that is and is not: it is the same remedy you propose, applied at the one seam a plugin owns, for deployments that cannot patch Honest boundary: I have not run your suite or the repository's tests, and I have not injected a real buffer overflow at a gateway. The evidence above is a source-level comparison plus pi-ai's own published tables, read from the installed distributions. |
|
Following the analysis above, this gap now has a shipped plugin form — and the
plugins:
empty-response-retry:
module: '@argszero/cordis-plugin-empty-response-retry'What the third report actually exposedThe proposal in the report is one more alternative in the But the sentence in question is already in pi-ai's own retry table, and that is
What the plugin does about itA third recognition, in the same The shipped default list is deliberately the server-shaped half of pi-ai's The honest limit of this formThis is a plugin, so it can only restore the decision at the boundary — it cannot Also addressed here, from the same seam: the empty-response case (#8321) and the |
Uh oh!
There was an error while loading. Please reload this page.
问题
在 GPT / openai-codex 会话中,上游返回以下错误时,DSH 将它归类为
PI_AI_ERROR,直接结束当前请求,没有进入正常退避重试:环境与观测
0.2.0-rc.20.87.1v24.19.0,dsh web,openai-codex路由。assistant/attempt记录均为PI_AI_ERROR,对应失败之后没有llm/retry/llm/retry-started,随后turn/end以错误结束。原因
当前 master 的 classifyPiAiError 仅通过数字
5xx识别SERVER。上述纯文本没有状态码,也未命中其他分类,因此落入PI_AI_ERROR。Harness 给 pi-ai 设置
maxRetries: 0,交由dsh-llm-retry统一恢复。默认重试集合包含SERVER,但不包含兜底的PI_AI_ERROR;因此这一分类遗漏使正常重试被跳过。pi-ai 0.87.1 的
utils/retry.js已将这句完整文本列为可重试错误。该文本也与 Envoy 的上游重试缓冲溢出分支一致,该分支返回 HTTP507。当状态码包含在消息中时,DSH 已会归类为SERVER;仅因状态码没有保留,恢复行为就发生了变化。这里报告的是文本分类缺口,并非已确认远端使用哪一跳代理或其缓冲阈值。它应区别于既有
HTTP 413/Failed to buffer the request body: length limit exceeded请求正文大小错误。最小修正建议
只扩展现有
SERVER分支,保持所有更高优先级分类、重试次数和错误消息不变:不建议把所有
PI_AI_ERROR加入默认重试集合,也不建议重新开启 SDK 内部重试或泛化匹配所有 buffer / request-too-large 消息。本建议不附回归测试补丁。本地验证范围
已在安装的发布包上用模拟 pi-ai 终止事件复现旧分类与跳过重试的行为。通过窄范围本地兼容补丁将该消息映射为
SERVER后,现有恢复插件会安排重试;后续成功、默认 5 次重试上限及取消行为均已验证。未对真实远端网关主动注入缓冲故障,未在官方源码树执行完整测试套件。持续的上游故障仍可能在重试耗尽后结束;这项修正仅恢复已有的有界重试路径,不宣称消除远端容量限制。
相关分类缺口讨论:#8844、#3407。本报告聚焦没有状态码的上游重试缓冲错误。
All reactions