Skip to content

[FEATURE]: Background Chat Generation #348

@Xiao-ao-jiang-hu

Description

@Xiao-ao-jiang-hu

📝 Feature Description [Please make everyone to understand it]

Currently, when a user chats with the AI, the response generation stops immediately if they close the chat window or switch to another conversation. Additionally, users cannot delete unwanted chat sessions.

We propose two key improvements:

  1. Background Generation: Allow AI responses to continue generating in the background even if the user navigates away or switches to another chat session.
  2. Session Deletion: Enable users to manually delete any chat session they no longer need.

These changes will significantly improve multitasking and user control over their conversation history.

👍 What problem does this feature solve

  • Prevents loss of partially generated responses when switching between chats or temporarily leaving the app.
  • Enables true multi-session handling—users can start multiple conversations and let them process concurrently.
  • Gives users full control over their data by allowing them to clean up obsolete or sensitive chat sessions.

👾 What does the proposed API look like

1. Background Generation Support

  • The frontend should not cancel the ongoing request when navigating away.
  • The backend must support long-running generation tasks tied to a session ID, independent of active UI state.
  • Optional: Add a task/status endpoint to query generation progress:

2. Delete Session API

  • Should remove all messages, metadata, and cancel any pending generation for that session.
  • Frontend should reflect the deletion immediately (e.g., remove from sidebar).

🚑 Any additional information

  • Background generation should respect system resource limits (e.g., max 3 concurrent generations per user).
  • Deleted sessions must be permanently removed from both frontend cache and backend storage for privacy compliance.
  • Consider showing a visual indicator (e.g., spinner or “generating…” badge) for sessions still processing in the background.
  • This feature is especially valuable for mobile users who frequently switch apps or for power users managing multiple complex queries at once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions