Open hashcacher opened 2 months ago
Correction: if I delete the Claude Chat buffer and open a new one, it works again.
Thank you for this plugin, by the way!
You can also manually update whatever is at the end of the buffer to restore the alternating flow.
If you can share exactly how last few lines of the buffer look like, we can consider how to handle this better.
Just encountered this again. This time I was focused on another buffer while Claude was outputting. It ended up appending You: to the buffer I was browsing instead of the Claude Chat buffer. And then the Chat stopped working. Here's a direct copy paste, starting with the end of the last Claude output:
(this is the end of claude's last output)
Is there anything else you'd like me to adjust or explain regarding these mobile-friendly changes?
(this is me trying to send another message)
The buttons at the bottom are cut off
(I hit c-], claude's response:)
Claude: Unknown Claude protocol output: "{"type":"error","error":{"type":"invalid_request_error","message":"Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported."}}"
(I add a You:, trying to restore the flow)
You: The buttons at the bottom are cut off
Claude: Unknown Claude protocol output: "{"type":"error","error":{"type":"invalid_request_error","message":"messages: roles must alternate between \"user\" and \"assistant\", but found multiple \"assistant\" roles in a row"}}"
Ah, interesting, so somehow "The buttons at the bottom are cut off" line is missing a "You:" prefix.
And I assume you reposted the line with the prefix rather than coming back to the previous line and adding the prefix there? So the dialog ended up with two Claude: lines in a row.
I think in the future it would be nice to do two things:
It seems to always happen when claude cuts itself off due to max output size. Here's another example, beginning with some cut off output from Claude:
{values.map(value => (
<label key={value} className="inline-flex items-center mr-4 mb
You:continue
Claude: Unknown Claude protocol output: "{"type":"error","error":{"type":"invalid_request_error","message":"messages: final assistant content cannot end with trailing whitespace"}}"
You:continue
Claude: Unknown Claude protocol output: "{"type":"error","error":{"type":"invalid_request_error","message":"messages: roles must alternate between \"user\" and \"assistant\", but found multiple \"assistant\" roles in a row"}}"
Wow that never happenned to me, interesting!
(PR would be welcome. Also just to be clear, is the workaround to fix the output in the buffer clear?)
P.S. you may want to increase the 2048 max_tokens limit
Ah, interesting, so somehow "The buttons at the bottom are cut off" line is missing a "You:" prefix.
that's correct, as I had my cursor in another buffer when the output finished, so it dumped the You: there instead of the claude chat
Wow that never happenned to me, interesting!
(PR would be welcome. Also just to be clear, is the workaround to fix the output in the buffer clear?)
P.S. you may want to increase the 2048 max_tokens limit
Thanks for the tip about the max_tokens limit. Yeah once it starts erroring, the only fix I've found is to delete the buffer.
You don't need to delete the whole buffer, you can just edit the last lines of it as appropriate to fix the issue manually.
When the max token issue happens, I try to close the ` block and write You: continue but it doesn't work
(the end of the last code claude was outputting)
Save
</button>
You:continue
Claude: Unknown Claude protocol output: "{"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"}}"
A claude chat response seemed to reach the output context limit, so I asked it to continue, and I got:
Now all my message result in this response.cx results in
The only solution I can find is to restart vim