fix: show Missing Nodes dialog for missing node prompt errors

- Detect 'missing_node_type' error from backend in queuePrompt catch block
- Construct MissingNodeType with class type and contextual hint
- Trigger existing showMissingNodesError() to display Missing Nodes dialog
- Dialog provides 'Open Manager' and 'Install All' buttons for resolution

Fixes COM-12528

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c0df1-aa57-72e0-8193-46aa24b5a327
This commit is contained in:
bymyself
2026-01-30 14:00:51 -08:00
parent 985d024a6e
commit 556f9ee00a

View File

@@ -1394,10 +1394,40 @@ export class ComfyApp {
} catch (error) {}
}
} catch (error: unknown) {
useDialogService().showErrorDialog(error, {
title: t('errorDialog.promptExecutionError'),
reportType: 'promptExecutionError'
})
if (
error instanceof PromptExecutionError &&
typeof error.response.error === 'object' &&
error.response.error?.type === 'missing_node_type'
) {
const extraInfo = (error.response.error.extra_info ?? {}) as {
class_type?: string | null
node_title?: string | null
node_id?: string
}
const classType = extraInfo.class_type ?? 'Unknown'
const nodeTitle = extraInfo.node_title ?? classType
const nodeId = extraInfo.node_id
const hint = (() => {
if (nodeTitle !== classType && nodeId) {
return `"${nodeTitle}" (Node ID #${nodeId})`
} else if (nodeTitle !== classType) {
return `"${nodeTitle}"`
} else if (nodeId) {
return `Node ID #${nodeId}`
}
return undefined
})()
const missingNodeType: MissingNodeType = {
type: classType,
...(hint && { hint })
}
this.showMissingNodesError([missingNodeType])
} else {
useDialogService().showErrorDialog(error, {
title: t('errorDialog.promptExecutionError'),
reportType: 'promptExecutionError'
})
}
console.error(error)
if (error instanceof PromptExecutionError) {