AI_APICallError: messages: final assistant content cannot end with trailing whitespace #1686

Closed
opened 2026-02-16 17:32:09 -05:00 by yindo · 7 comments
Owner

Originally created by @marcinpz on GitHub (Sep 11, 2025).

Originally assigned to: @thdxr on GitHub.

Ocasionally getting this error during normal work:

AI_APICallError: messages: final assistant content cannot end with trailing whitespace
Originally created by @marcinpz on GitHub (Sep 11, 2025). Originally assigned to: @thdxr on GitHub. Ocasionally getting this error during normal work: ``` AI_APICallError: messages: final assistant content cannot end with trailing whitespace ```
yindo closed this issue 2026-02-16 17:32:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 11, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1295: Exact same error message "AI_APICallError: messages: final assistant content cannot end with trailing whitespace" (closed issue)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 11, 2025): This issue might be a duplicate of existing issues. Please check: - #1295: Exact same error message "AI_APICallError: messages: final assistant content cannot end with trailing whitespace" (closed issue) Feel free to ignore if none of these address your specific case.
Author
Owner

@marcinpz commented on GitHub (Sep 11, 2025):

So i am using the newest version 0.7.1 - issue is the same but #1295 is old and closed.

@marcinpz commented on GitHub (Sep 11, 2025): So i am using the newest version 0.7.1 - issue is the same but #1295 is old and closed.
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

what provider?

@rekram1-node commented on GitHub (Sep 11, 2025): what provider?
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

also can you provide a share link perhaps

@rekram1-node commented on GitHub (Sep 11, 2025): also can you provide a share link perhaps
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

Did this happen during a compact? Saw someone else have that

@rekram1-node commented on GitHub (Sep 11, 2025): Did this happen during a compact? Saw someone else have that
Author
Owner

@marcinpz commented on GitHub (Sep 12, 2025):

I am using Claude sonnet 4 mostly via GitHub copilot. I am not using compact - but maybe it is connected to context being large - it often goes beyond 100% but I did not notice error about that. Another issues I am observing is "Generating..." (And nothing done) And hangs (hard to write anything).
Generally restart helps for these issues and probably these are perf related (but I have 64GB Ram and latest intel CPU).
I am working under Wsl, Ubuntu.
I can't share the session...

@marcinpz commented on GitHub (Sep 12, 2025): I am using Claude sonnet 4 mostly via GitHub copilot. I am not using compact - but maybe it is connected to context being large - it often goes beyond 100% but I did not notice error about that. Another issues I am observing is "Generating..." (And nothing done) And hangs (hard to write anything). Generally restart helps for these issues and probably these are perf related (but I have 64GB Ram and latest intel CPU). I am working under Wsl, Ubuntu. I can't share the session...
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1686