GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AI_APICallError: messages.157: all messages must have non-empty content except for the optional final assistant message · Issue #2655 · anomalyco/opencode

AI_APICallError: messages.157: all messages must have non-empty content except for the optional final assistant message #2655

New issue
Copy link
New issue
Copy link
Closed
Closed
AI_APICallError: messages.157: all messages must have non-empty content except for the optional final assistant message#2655
Copy link
Assignees
rekram1-node

Description

@esafak
esafak
opened on Sep 17, 2025
Issue body actions

This is with anthropic claude opus 4.1, opencode 0.9.11, nushell on macos.

Activity

  1. github-actions commented on Sep 17, 2025

    @github-actions
    github-actionsBot
    on Sep 17, 2025 – with GitHub Actions
    Contributor
    More actions

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

    • AI_APICallError: messages: final assistant content cannot end with trailing whitespace #2546: Similar API error about message content validation with trailing whitespace
    • "AI_APICallError: Text content blocks must contain non-whitespace text" on /compact #1681: Related error about text content blocks requiring non-whitespace text
    • AI_APICallError: messages: final assistant content cannot end with trailing whitespace #1295: Same exact error about final assistant content and trailing whitespace

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

  2. rekram1-node commented on Sep 17, 2025

    @rekram1-node
    rekram1-node
    on Sep 17, 2025
    Member
    More actions

    I just fixed this: #2651

    Assuming you had a message you aborted in the session?

    U may be able to get around this by doing a /undo and then continuing

    Either way: in next release this should be fixed!

  3. rekram1-node
    self-assigned this
    on Sep 17, 2025
  4. esafak commented on Sep 17, 2025

    @esafak
    esafak
    on Sep 17, 2025
    ContributorAuthor
    More actions

    Aborting often results in such errors, yes. Does undo delete the last entry?

  5. rekram1-node commented on Sep 17, 2025

    @rekram1-node
    rekram1-node
    on Sep 17, 2025 – with Linear
    Member
    More actions

    Yeah it will rewind to your last message so the most recent loop + last message you sent are all "deleted" (you can hit /redo too) and the prompt box will be populated with the last msg you sent

    Reacted by Emre Şafak
  6. rekram1-node commented on Sep 18, 2025

    @rekram1-node
    rekram1-node
    on Sep 18, 2025
    Member
    More actions

    closing since commit to fix has been merged, will be in next release

  7. rekram1-node
    closed this as completedon Sep 18, 2025
  8. arshbot commented on Dec 27, 2025

    @arshbot
    arshbot
    on Dec 27, 2025
    More actions

    Running into this issue again, /undo doesn't seem to get past it. Occurred after linking anthropic mid chat. chat window froze and window had to be closed.

  9. andymac4182 commented on Jan 4, 2026

    @andymac4182
    andymac4182
    on Jan 4, 2026
    More actions

    I am still getting this. It appears to have happened again.

  10. rekram1-node commented on Jan 4, 2026

    @rekram1-node
    rekram1-node
    on Jan 4, 2026
    Member
    More actions

    @andymac4182 can u share a session?

  11. arshbot commented on Jan 4, 2026

    @arshbot
    arshbot
    on Jan 4, 2026
    More actions

    Can reproduce by starting a session with glm, and later switching to any anthropic model.

  12. rekram1-node commented on Jan 4, 2026

    @rekram1-node
    rekram1-node
    on Jan 4, 2026
    Member
    More actions

    ahh

  13. madeleineostoja commented on Feb 4, 2026

    @madeleineostoja
    madeleineostoja
    on Feb 4, 2026
    More actions

    Also still seeing this error, exclusively when interrupting an agent while thinking

  14. kiennq commented on Feb 7, 2026

    @kiennq
    kiennq
    on Feb 7, 2026
    More actions

    I got this issue with Copilot Claude model, we should expand the check for trimming to all anthropic models, regardless of ai-sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.