Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages leak to other users #479

Open
Tetr4 opened this issue Jan 13, 2025 · 1 comment
Open

Messages leak to other users #479

Tetr4 opened this issue Jan 13, 2025 · 1 comment

Comments

@Tetr4
Copy link

Tetr4 commented Jan 13, 2025

When two users make a request for the streaming endpoint at the same time, user A's stream will contain chat engine events from user B's stream. This leaks user B's message to user A, if the events contain the message as a context query:

{
    "type": "events",
    "data": {
        "title": "Retrieving context for query: 'Show me articles related to machine learning.\n'"
    }
}

A workaround is to remove the event_handler from VercelStreamResponse. Ideally these chat engine events should only be emitted to the request that triggered them, but i am not sure if that is possible.

@marcusschiesser marcusschiesser moved this to In Progress in Framework Jan 15, 2025
@leehuwuj
Copy link
Collaborator

Hi @Tetr4 , How did you run the API? Theoretically, if you start the FastAPI app with Uvicorn, each user request is handled by a single worker, so there should be no data race.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants