fix: keep model selector visible when loading fails - #711
Merged
Merged
Conversation
sleepinginsummer
pushed a commit
to sleepinginsummer/pi-web
that referenced
this pull request
Sep 9, 2026
* fix: keep model selector visible when loading fails * fix: surface model loading failures and ignore cancelled requests --------- Co-authored-by: Alex Yang <agegcn@gmail.com>
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.
摘要
当
/api/models请求失败时,模型选择器现在会保留在界面中,并显示具体错误信息。对于开发服务器冷启动、服务重启或 cwd allow-list 尚未同步等瞬时故障,前端会按退避策略自动重试,避免模型选择器静默隐藏。变更内容
error字段,并将具体错误展示给用户。影响范围
hooks/useAgentSession.ts验证
npm 测试 — 844 tests 通过。tsc --noEmit。npm run lint。git diff --check。English
Title
Fix the model selector being hidden when model loading fails
Summary
When
/api/modelsfails, the model selector now remains visible and displays a useful error message. For transient failures caused by a dev-server cold start, server restart, or a cwd allow-list race, the client retries with backoff instead of leaving the selector hidden prematurely.Changes
errorfield from non-success JSON responses and surfaced it to the UI.Scope
hooks/useAgentSession.tsVerification
npm test — 844 tests passed。tsc --noEmit。npm run lint。git diff --check。