fix: show visible error when model is unavailable#592
Merged
Conversation
stephamie7
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
测试反馈「偶发:模型不回复,如果是模型不可用需要返回信息」。排查发现模型不可用、provider 未配置、模型返回空流等场景下,后端可能没有生成可见 assistant 回复,或前端把空 text part 渲染为空白。
修改
message.error存在但 text part 为空时渲染错误态。验证
uv run pytest tests/session/test_runner_step.py::test_process_step_persists_visible_error_when_provider_missing tests/session/test_runner_step.py::test_process_step_persists_visible_error_when_provider_not_configured tests/session/test_runner_step.py::test_process_step_persists_visible_error_when_model_returns_empty_stream -quv run ruff check flocks/session/runner.py tests/session/test_runner_step.pycd webui && npm run test:run -- src/components/common/SessionChat.test.ts -t "SessionChat error rendering|getMessageErrorText"