Skip to content

fix(chat): 模型 400 错误按原因分类,横幅可点开 - #188

Merged
Slacker-LLC merged 1 commit into
mainfrom
fix/llm-400-reasons
Oct 10, 2026
Merged

Slacker-LLC merged 1 commit into
mainfrom
fix/llm-400-reasons

Conversation

@Slacker-LLC

Copy link
Copy Markdown
Owner

问题

聊天里模型报错几乎都显示同一句"服务商拒绝了这次请求(400)……",不同原因分不开;"详情"里是服务商原文(英文),在中文界面里混着英文,而且横幅只显示 4 行。

改动

  • LLMErrorPresenter:400 现在按服务商返回的文字细分为五类并给出对应说明——工具调用缺少结果、对话太长、图片、模型名、思考档位;其余仍是原来的通用 400 说明。只细分 400,413/404/422/5xx 不变。
  • 服务商原文前加标签(8 种语言:"服务商原文:…"),说明这段是服务商自己的文字,不随界面语言变化。
  • 错误横幅点一下展开全文,再点收起(原来最多 4 行)。
  • 新增 4 个单测,含否定用例:只是长得像的 400(比如 tool_call_id 过长、空正文)仍走通用说明;非 400 状态不被细分。

验证

  • 全量单测通过;LLMErrorPresenterTest 在 rebase 到 main(284b87a)后再次通过。
  • 未验证:没有在真机上让服务商真正返回这些 400 去触发;各家错误措辞按已知格式写,覆盖不全的会落到通用说明。

没解决的(需要日志)

截图里第二条错误 "No tool output found for function call…" 是 OpenAI Responses 的措辞:请求里有 function_call 却没有对应的 function_call_output。这是 Minis 自己历史重放的问题,与模型名、思考档位、附件无关。根因未定位,怀疑与重放原始 providerOutputItems 或失败轮次后的工具块有关(未验证)。需要设备上的 App 日志或该次请求体才能继续。本 PR 只负责把原因说清楚。

🤖 Generated with Claude Code

https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3


Generated by Claude Code

A provider's 400 now says what it is about when the text allows: a tool call without its result, a
conversation that is too long, an image, the model name or the thinking level. Everything else stays
the general 400 message. The provider's own text is labelled as such, and the banner expands on tap.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
@Slacker-LLC
Slacker-LLC merged commit 5de6719 into main Oct 10, 2026
14 checks passed
@Slacker-LLC
Slacker-LLC deleted the fix/llm-400-reasons branch October 10, 2026 17:05
Slacker-LLC pushed a commit that referenced this pull request Oct 10, 2026
#186, #188 and #189 landed on main. The merge was clean (CHANGELOG, 06-CURRENT-GAPS
and the string files only had adjacent additions); CI on this head tests the combination.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
Slacker-LLC added a commit that referenced this pull request Oct 10, 2026
Version 0.0.3. Moves the Unreleased changelog entries under 0.0.3 and adds the
missing note for the classified, expandable 400 error banner (#188).


Claude-Session: https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants