Repository navigation
fix(home): report a failed assistant config load instead of a dead input - #6082
Merged
Merged
Conversation
The home page loaded the assistant configuration with `getLlmConfig().catch(() => null)`, so a failed request was stored as "there is no configuration". The shared composer explains a missing configuration only when it has one (`Composer` renders its not-ready banner and status tag behind `llmConfig && ...`) while the send action requires `llmReady`, so the failure left the input box disabled with no reason shown, no retry, and no way to tell it apart from a page that is still loading. The failure is now a state: the page reports `llm.loadFailed` above the composer with a retry that re-runs the load, and the recovered configuration drives the composer again. The model fallback is unchanged - the home model list is still offered when the configuration cannot be read.
This was referenced Oct 13, 2026
lizhimins
pushed a commit
that referenced
this pull request
Oct 15, 2026
…pty form (#6550) The AI assistant settings tab reported a failed configuration load as a transient toast and then rendered the form anyway, with every field empty and the API key slot prompting for a key - the tab claimed that nothing is configured. The load request is admin-only on the server (`AuthInterceptor.isAdminOnlyGetPath` covers `/api/llm/config` and `/api/llm/models`), so a reader opening Settings sees that blank configuration on every visit, and an administrator's transient failure is indistinguishable from an empty configuration as well. The tab keeps the server's reason and offers a retry: a failed load now renders an error notice above the form with the message the request failed with ("Admin permission required" for a reader) and a retry button that re-runs the load, clearing the notice once it succeeds. `AlertRuleAssetList` already uses this shape for its own list, and the home page's assistant load failure is handled the same way in #6082. No new copy: the notice and the button reuse `llm.loadFailed` and `common.retry`.
This was referenced Oct 15, 2026
|
This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes. |
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.
Which Issue(s) This PR Fixes
Brief Description
The home page loaded the assistant configuration with
getLlmConfig().catch(() => null)(
web/src/pages/home/index.tsx:118), so a failed request was stored as "there is no configuration" —indistinguishable from the state before the response arrives. The shared composer explains a missing
configuration only when it has one: its not-ready banner and status tag are both behind
llmConfig && ...(
web/src/pages/ai/components/Composer.tsx:312,:425), while the send action requiresllmReady(
index.tsx:100-101). A failedGET /api/llm/configtherefore left the input box disabled with no reasonshown, no retry, and nothing to tell it apart from a page that is still loading.
The failure is now a state: the load is wrapped in try/catch, the page renders
llm.loadFailedabove thecomposer with a retry that re-runs the load, and the recovered configuration drives the composer again.
User-visible change: on the home page a failed assistant-configuration request now says so ("加载AI配置失败"
/ "Failed to load AI config") and can be retried; before, the input box was silently dead. No new
user-facing copy was introduced —
llm.loadFailedandcommon.retryalready exist with Chinese andEnglish entries.
The model fallback is unchanged: when the configuration cannot be read, the home model list is still
offered and the recommended model is still preselected.
How Did You Test This Change?
The new test fails without the fix:
(That run is
pages/home/index.tsxreverted and the new test kept, which is also the mutation check; thecase is green again once the fix is restored. The test also pins the recovery: after the retry the composer
reports its provider status and a prompt is handed to the AI page again.)
Checklist
feat:/fix:/refactor:/chore:/docs:/perf:)...Testweb/src/i18n/mvn testruns the ArchUnit checks)docs// in-app help)