-
Notifications
You must be signed in to change notification settings - Fork 101
refactor(web): dissolve reconcileFromDaemonConfig bridge utility (LUM-2239) #33464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2ed20e7
b5d1110
85a4ec5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,7 @@ import { secretPlaceholder } from "@/domains/settings/ai/secret-placeholder"; | |||||
|
|
||||||
| import type { ServiceMode } from "@/domains/settings/ai/ai-types"; | ||||||
| import { LS_WEB_SEARCH_MODE, LS_WEB_SEARCH_PROVIDER } from "@/domains/settings/ai/ai-types"; | ||||||
| import { getWebSearchProviderKeyStorage, reconcileFromDaemonConfig } from "@/domains/settings/ai/ai-utils"; | ||||||
| import { getWebSearchProviderKeyStorage } from "@/domains/settings/ai/ai-utils"; | ||||||
| import { ServiceCard, SaveButton, ResetButton } from "@/domains/settings/ai/ai-shared-ui"; | ||||||
| import { useDaemonConfigQuery, useDaemonConfigMutation, useProvisionProviderKey } from "@/domains/settings/ai/use-daemon-config"; | ||||||
| import { useDraftOverride } from "@/domains/settings/ai/use-draft-override"; | ||||||
|
|
@@ -46,10 +46,11 @@ export function WebSearchCard() { | |||||
| serverWebSearchProvider: getLocalSetting(LS_WEB_SEARCH_PROVIDER, "inference-provider-native"), | ||||||
| }; | ||||||
| } | ||||||
| const reconciled = reconcileFromDaemonConfig(daemonConfig); | ||||||
| const wsService = daemonConfig.services?.["web-search"]; | ||||||
| const mode = wsService?.mode; | ||||||
| return { | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Web search mode now uses unchecked raw config values
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already fixed in b5d1110 — both cards now validate |
||||||
| serverWebSearchMode: (reconciled.webSearchMode ?? getLocalSetting(LS_WEB_SEARCH_MODE, "your-own")) as ServiceMode, | ||||||
| serverWebSearchProvider: reconciled.webSearchProvider ?? getLocalSetting(LS_WEB_SEARCH_PROVIDER, "inference-provider-native"), | ||||||
| serverWebSearchMode: (mode === "managed" || mode === "your-own" ? mode : getLocalSetting(LS_WEB_SEARCH_MODE, "your-own")) as ServiceMode, | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Provider fallback semantic change depends on whether empty-string providers can still exist
Was this helpful? React with 👍 or 👎 to provide feedback.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid finding — the old code used |
||||||
| serverWebSearchProvider: wsService?.provider || getLocalSetting(LS_WEB_SEARCH_PROVIDER, "inference-provider-native"), | ||||||
| }; | ||||||
| }, [daemonConfig]); | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Image generation mode now accepts invalid raw config values without validation
serverImageGenModenow directly castsdaemonConfig.services["image-generation"].modetoServiceMode, so any non-enum string in raw config is treated as a valid UI mode. The daemon’sGET /v1/configresponse is based on raw config (loadRawConfig) rather than schema-validated config, andPATCH /v1/configaccepts arbitrary objects via deep-merge, so malformed/stale mode values can exist and be returned (assistant/src/runtime/routes/conversation-query-routes.ts:447-452,assistant/src/config/loader.ts:875-916,assistant/src/runtime/routes/conversation-query-routes.ts:586-603). This regresses the previous guard logic and can leave the segment control in an invalid state and allow re-saving the invalid mode value.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in b5d1110 — the mode validation guard was restored in the previous commit.