Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,26 @@ export function SessionPromptInput({
toast.error('Goal Mode does not support attachments.');
return false;
}
const result = await trpcClient.fastSessions.startGoal.mutate({
sessionId,
objective,
});
if (!result.success) {
toast.error(result.error);
try {
const result = await trpcClient.fastSessions.startGoal.mutate({
sessionId,
objective,
});
if (!result.success) {
toast.error(result.error);
return false;
}
toast.success(`Pursuing goal: ${objective}`);
sent = true;
} catch (error) {
toast.error('Could not start the goal.', {
description:
error instanceof Error && error.message
? error.message
: 'Try again shortly.',
});
return false;
}
toast.success(`Pursuing goal: ${objective}`);
sent = true;
} else {
// Always send the current picker state: it round-trips the persisted
// choice and clears it when the picker is reset to the default.
Expand Down
Loading