-
Notifications
You must be signed in to change notification settings - Fork 151
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
Losing chunks of replies #261
Comments
Thanks, I guess the fix in #233 isn't quite complete. I It's a timing based bug, so I'll need to set up a simulation of the streaming and try to find the right conditions to reproduce it. |
* gptel-anthropic.el (gptel-curl--parse-stream): Remove extraneous statements and simplify the stream parser. Addresses #261, but the main problem is still elusive.
@jwr Could you try this: Advise the stream filter as follows to capture the output (clear the scratch buffer first): (defun gptel-filter-debug (_ output)
(with-current-buffer (get-buffer-create "*scratch*")
(insert output "\n-----\n")))
(advice-add 'gptel-curl--stream-filter :before #'gptel-filter-debug) Use the Anthropic backend and reproduce the error, then paste the contents of the scratch buffer here. Remove the advice afterwards so you can use gptel normally. (advice-remove 'gptel-curl--stream-filter #'gptel-filter-debug) This should help me nail down the timing to test against. |
This doesn't seem to happen as often as before, but here are some examples: Output is "By combining anch n", should be "By combining anchored n":
Output is "the relev and accuracy", should be "the relevance and accuracy":
I hope this helps. |
I just realized you wanted the entire |
I'm having this same issue only with claude models as well. |
Yes, this seems to happen with Haiku, Sonnet and Opus. |
gptel-anthropic.el (gptel-curl--parse-stream): When parsing responses from Anthropic, wait for more input when the corresponding data chunk for the event hasn't arrived yet. (#261)
Pushed a commit (26326c3), please check if this is fixed now. |
I am no longer able to reproduce the problem 🙂🙏 Thank you! |
Unfortunately, I am experiencing this same issue, despite having updated to the latest commit (#70889ad). Attached are the contents of the *scratch* buffer, after following the instructions in this comment above. Not sure if it’s useful, but an example of missing text occurs in the sentence starting "Pero cuando encuentres algo que...". |
@benthamite thanks for the data. Do you have the text as it is inserted into your buffer? I'd like to know exactly which chunk was missed. |
@karthink, yes, I saved the In the example above, the truncated sentence is
I think the full full sentence should have been
|
(There are other examples. I can list them if that helps.) |
I only noticed this with Anthropic, but I am not 100% certain this applies to Anthropic only.
I get replies where often several characters are missing. I investigated, turned on logging and here is an example. In my output gptel session I see "dostępnośćwencji", while the log shows:
Note the missing " sek" chunk. It's there in the log, so this would indicate that we received it, but lost it afterwards.
This happens irregularly, sometimes 1-2 times per paragraph, sometimes once every several paragraphs.
This happens at least with output to a new buffer, or to a gptel session.
The text was updated successfully, but these errors were encountered: