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:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export type GatewayEventPayload = {
|
||||
running?: boolean
|
||||
cwd?: string
|
||||
branch?: string
|
||||
credential_warning?: string
|
||||
personality?: string
|
||||
usage?: Partial<UsageStats>
|
||||
// clarify.request
|
||||
|
||||
@@ -164,6 +164,8 @@ export interface SessionResumeResponse {
|
||||
|
||||
export interface SessionRuntimeInfo {
|
||||
branch?: string
|
||||
config_warning?: string
|
||||
credential_warning?: string
|
||||
cwd?: string
|
||||
fast?: boolean
|
||||
model?: string
|
||||
|
||||
Reference in New Issue
Block a user