Skip to content

Commit

Permalink
test kill app
Browse files Browse the repository at this point in the history
  • Loading branch information
zakiali committed Jan 12, 2025
1 parent a77a770 commit 0c286c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/goose-server/src/routes/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ async fn handler(
let _ = tx
.send(ProtocolFormatter::format_moderation_error(moderation_error))
.await;
// Kill the stream since we encountered a moderation error
} else {
// Send a generic error message
let _ = tx
Expand Down
12 changes: 11 additions & 1 deletion ui/desktop/src/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ function ChatContent({
if (!response.ok) {
setProgressMessage('An error occurred while receiving the response.');
updateWorking(Working.Idle);

// Check if this is a moderation error
if (response.status === 400) {
response.json().then(data => {
if (data.error && data.error.includes('moderation')) {
// Kill the goosed process for moderation violations
window.electron.stopGooseProcess();
}
});
}
} else {
setProgressMessage('thinking...');
updateWorking(Working.Working);
Expand Down Expand Up @@ -462,4 +472,4 @@ export default function ChatWindow() {
)}
</div>
);
}
}

0 comments on commit 0c286c7

Please sign in to comment.