Skip to content

Conversation

@SudoBrendan
Copy link

@SudoBrendan SudoBrendan commented May 16, 2025

Describe your changes

Returning a zero-value Error response on Done caused consumer of Recv() to process an extra, empty/duplicated message. This previously resulted in printing of things like 'hello' from the LLM as 'helloo' in mods. Done now signals end-of-stream as expected.

Related issue/discussion:

N/A - I can open if desired. Ollama streams currently print the last chunk multiple times (at least for me, locally):

$ mods --version
mods version v1.7.0 (c4461d4)
$ mods "Hi there"

  Hi! 😊

  It's nice to hear from you! What can I do for you today??
$ cat my-jira | mods "Is this epic groomed well?"

NoNo

$ mods --continue-last "what's wrong with the summary?"

Too verbose verbose verbose

Checklist before requesting a review

  • I have read CONTRIBUTING.md
    • There is no such file in this repo - it was the first thing I tried to find :( LMK if anything here is not in accordance with this community's standards.
  • I have performed a self-review of my code

If this is a feature

N/A - bugfix

  • I have created a discussion
  • A project maintainer has approved this feature request. Link to comment:

Returning a zero-value Error response on Done caused consumer of Recv()
to process an extra, empty/duplicated message. This previously resulted
in printing of things like 'hello' from the LLM as 'helloo' in mods.
Done now signals end-of-stream as expected.
@SudoBrendan SudoBrendan requested a review from caarlos0 as a code owner May 16, 2025 19:53
@caarlos0
Copy link
Member

caarlos0 commented May 22, 2025

I refactored this in #486 - feel free to take a look and comment

I think this will not be needed anymore with that in mind.

Thanks for the PR, though! 🙏🏻

@caarlos0 caarlos0 closed this May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants