fix(desktop): surface provider onboarding from session warnings

Propagate credential warnings through session runtime info and open desktop onboarding whenever a session reports no usable provider, so unconfigured installs cannot fall through to prompt errors.
This commit is contained in:
Brooklyn Nicholson 2026-05-07 22:44:55 -04:00
parent 8d95e006b8
commit c730a9976d
5 changed files with 16 additions and 3 deletions

View file

@ -17,6 +17,7 @@ import { coerceGatewayText, coerceThinkingText, normalizePersonalityValue } from
import { triggerHaptic } from '@/lib/haptics'
import { setClarifyRequest } from '@/store/clarify'
import { notify } from '@/store/notifications'
import { requestDesktopOnboarding } from '@/store/onboarding'
import {
setCurrentBranch,
setCurrentCwd,
@ -476,6 +477,10 @@ export function useMessageStream({
setCurrentUsage(current => ({ ...current, ...payload.usage }))
}
if (typeof payload?.credential_warning === 'string' && payload.credential_warning) {
requestDesktopOnboarding(payload.credential_warning)
}
void refreshHermesConfig()
if (modelChanged || providerChanged) {

View file

@ -9,6 +9,7 @@ import { embeddedImageUrls, textWithoutEmbeddedImages } from '@/lib/embedded-ima
import { clearComposerAttachments, clearComposerDraft } from '@/store/composer'
import { $pinnedSessionIds } from '@/store/layout'
import { clearNotifications, notify, notifyError } from '@/store/notifications'
import { requestDesktopOnboarding } from '@/store/onboarding'
import {
$messages,
$sessions,
@ -187,6 +188,10 @@ function applyRuntimeInfo(info: SessionCreateResponse['info'] | undefined) {
return
}
if (info.credential_warning) {
requestDesktopOnboarding(info.credential_warning)
}
if (info.model) {
setCurrentModel(info.model)
}

View file

@ -39,6 +39,7 @@ export type GatewayEventPayload = {
running?: boolean
cwd?: string
branch?: string
credential_warning?: string
personality?: string
usage?: Partial<UsageStats>
// clarify.request

View file

@ -164,6 +164,8 @@ export interface SessionResumeResponse {
export interface SessionRuntimeInfo {
branch?: string
config_warning?: string
credential_warning?: string
cwd?: string
fast?: boolean
model?: string

View file

@ -583,9 +583,6 @@ def _start_agent_build(sid: str, session: dict) -> None:
_notify_session_boundary("on_session_reset", key)
info = _session_info(agent, current)
warn = _probe_credentials(agent)
if warn:
info["credential_warning"] = warn
cfg_warn = _probe_config_health(_load_cfg())
if cfg_warn:
info["config_warning"] = cfg_warn
@ -1513,6 +1510,9 @@ def _session_info(agent, session: dict | None = None) -> dict:
info["update_command"] = recommended_update_command()
except Exception:
pass
warn = _probe_credentials(agent)
if warn:
info["credential_warning"] = warn
return info