Skip to content

Commit 248ce46

Browse files
rekram1-nodedavidgut1982
authored andcommitted
fix(tui): show prompt submission errors (anomalyco#31949)
1 parent 8b25631 commit 248ce46

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

packages/tui/src/component/prompt/index.tsx

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,22 +1086,31 @@ export function Prompt(props: PromptProps) {
10861086
} else {
10871087
move.startSubmit()
10881088
sdk.client.session
1089-
.prompt({
1090-
sessionID,
1091-
...selectedModel,
1092-
agent: agent.name,
1093-
model: selectedModel,
1094-
variant,
1095-
parts: [
1096-
...editorParts,
1097-
{
1098-
type: "text",
1099-
text: inputText,
1100-
},
1101-
...nonTextParts,
1102-
],
1089+
.prompt(
1090+
{
1091+
sessionID,
1092+
...selectedModel,
1093+
agent: agent.name,
1094+
model: selectedModel,
1095+
variant,
1096+
parts: [
1097+
...editorParts,
1098+
{
1099+
type: "text",
1100+
text: inputText,
1101+
},
1102+
...nonTextParts,
1103+
],
1104+
},
1105+
{ throwOnError: true },
1106+
)
1107+
.catch((error) => {
1108+
toast.show({
1109+
title: "Failed to send prompt",
1110+
message: errorMessage(error),
1111+
variant: "error",
1112+
})
11031113
})
1104-
.catch(() => {})
11051114
if (editorParts.length > 0) editor.markSelectionSent()
11061115
}
11071116
history.append({

0 commit comments

Comments
 (0)