Skip to content

[FEATURE] Add "Stop generation" button to cancel ongoing AI response #364

@adikulkarni006

Description

@adikulkarni006

Problem
When the AI is generating a long response (streaming), users have no way to stop it mid-way. They have to wait or refresh the page.

Expected behavior

  • While AI is streaming, a red "Stop" button (■) appears next to the message or in the input area.
  • Clicking it cancels the current generation.
  • Abort the fetch request (using AbortController).
  • The partial response remains as is, and a note "[Stopped by user]" is appended.

Technical hints

  • Frontend: frontend/src/components/ChatWindow.jsx – manage an AbortController for the streaming request.
  • Add state isGenerating to show/hide stop button.
  • On stop, call abortController.abort() and update UI.

Labels: enhancement, good-first-issue, SSoC26

Metadata

Metadata

Labels

BeginnerSSoC26Part of Social Summer of Code 2026

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions