fix(settings): stabilize websearch and quota checks

This commit is contained in:
Tam Nhu Tran
2026-03-25 16:31:55 -04:00
parent a97fc42b10
commit 3ea9d2fc34
5 changed files with 149 additions and 163 deletions
+14 -8
View File
@@ -180,14 +180,11 @@ export function getCliInstallHints(): string[] {
];
}
/**
* Get WebSearch readiness status for display.
*/
export function getWebSearchReadiness(): WebSearchStatus {
const wsConfig = getWebSearchConfig();
const providers = getWebSearchCliProviders();
if (!wsConfig.enabled) {
export function buildWebSearchReadiness(
enabled: boolean,
providers: WebSearchCliInfo[]
): WebSearchStatus {
if (!enabled) {
return {
readiness: 'unavailable',
message: 'Disabled in config',
@@ -223,6 +220,15 @@ export function getWebSearchReadiness(): WebSearchStatus {
};
}
/**
* Get WebSearch readiness status for display.
*/
export function getWebSearchReadiness(): WebSearchStatus {
const wsConfig = getWebSearchConfig();
const providers = getWebSearchCliProviders();
return buildWebSearchReadiness(wsConfig.enabled, providers);
}
/**
* Display WebSearch status (single line, equilibrium UX).
*/