mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-21 10:16:03 +00:00
fix(tui): show prompt submission errors (#31949)
This commit is contained in:
@@ -1086,22 +1086,31 @@ export function Prompt(props: PromptProps) {
|
|||||||
} else {
|
} else {
|
||||||
move.startSubmit()
|
move.startSubmit()
|
||||||
sdk.client.session
|
sdk.client.session
|
||||||
.prompt({
|
.prompt(
|
||||||
sessionID,
|
{
|
||||||
...selectedModel,
|
sessionID,
|
||||||
agent: agent.name,
|
...selectedModel,
|
||||||
model: selectedModel,
|
agent: agent.name,
|
||||||
variant,
|
model: selectedModel,
|
||||||
parts: [
|
variant,
|
||||||
...editorParts,
|
parts: [
|
||||||
{
|
...editorParts,
|
||||||
type: "text",
|
{
|
||||||
text: inputText,
|
type: "text",
|
||||||
},
|
text: inputText,
|
||||||
...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({
|
||||||
|
|||||||
Reference in New Issue
Block a user