fix(tui): show prompt submission errors (#31949)
This commit is contained in:
parent
9eb07ab55a
commit
ca8db315a9
1 changed files with 24 additions and 15 deletions
|
|
@ -1086,7 +1086,8 @@ export function Prompt(props: PromptProps) {
|
||||||
} else {
|
} else {
|
||||||
move.startSubmit()
|
move.startSubmit()
|
||||||
sdk.client.session
|
sdk.client.session
|
||||||
.prompt({
|
.prompt(
|
||||||
|
{
|
||||||
sessionID,
|
sessionID,
|
||||||
...selectedModel,
|
...selectedModel,
|
||||||
agent: agent.name,
|
agent: agent.name,
|
||||||
|
|
@ -1100,8 +1101,16 @@ export function Prompt(props: PromptProps) {
|
||||||
},
|
},
|
||||||
...nonTextParts,
|
...nonTextParts,
|
||||||
],
|
],
|
||||||
|
},
|
||||||
|
{ throwOnError: true },
|
||||||
|
)
|
||||||
|
.catch((error) => {
|
||||||
|
toast.show({
|
||||||
|
title: "Failed to send prompt",
|
||||||
|
message: errorMessage(error),
|
||||||
|
variant: "error",
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
|
||||||
if (editorParts.length > 0) editor.markSelectionSent()
|
if (editorParts.length > 0) editor.markSelectionSent()
|
||||||
}
|
}
|
||||||
history.append({
|
history.append({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue