[BUG] Chat gets re-downloaded every 2 seconds while a response is streaming

Open
#1,069 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
60/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
dart, flutter
Domain
mobile

Research direction

Start with streaming_helper.dart, especially scheduleTerminalCompletionRecovery, and trace when its timer is armed and re-armed relative to socket events. Check the existing streaming and recovery tests before changing behavior. Done means a healthy socket delivering events does not trigger repeated full-chat fetches, while recovery still works when the socket goes quiet or reconnects.

Written by the indexing model from the issue text.

Description

bug
App Version

4.3.1

Platform
  • Android
  • iOS
How you installed it

GitHub Releases

What happened?

While a response is streaming, Conduit calls GET /api/v1/chats/{id} about every 2 seconds until the message is done, even when the socket is healthy.

On an 11-minute tool loop in a 2–3 MB chat that was 162 full-chat downloads, about 347 MB. On cellular that's a lot of data and battery for content the socket already delivers.

It looks like scheduleTerminalCompletionRecovery in streaming_helper.dart starts right after the /api/chat/completions POST returns and re-arms its 2 s timer until the message is done.

What should have happened?

No full-chat fetches while the socket is delivering events. Maybe poll only when the socket goes quiet or after a reconnect, and pause in the background.

How to reproduce
  1. Watch the Open WebUI access log (mine is 0.13.3).
  2. Send a message that takes a while to answer.
  3. See GET /api/v1/chats/{id} about every 2 seconds until it finishes.
Does this happen every time?

Yes, every time

When did this start?

Not sure, noticed it today.

Screenshots

No response

Logs

No response

Dominant language
Dart
Stars
2.4k
Forks
280
Avg merge
23h 57m
Merged PRs (30d)
191

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cogwheel0/conduit

All issues in cogwheel0/conduit

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.