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 — fix: filter empty messages in toModelMessage by Tarquinen · Pull Request #4811 · anomalyco/opencode

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 27, 2025

Copy link
Copy Markdown
Member

Summary

  • Filter out messages with empty parts arrays before sending to provider API

Problem

Related to #2655

Messages with only ignored: true text parts pass the initial parts.length === 0 check but end up with empty content after filtering, causing provider API errors:

messages.X: all messages must have non-empty content except for the optional final assistant message

Solution

Filter messages with empty parts after processing, before convertToModelMessages().

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Tarquinen
fix: filter empty messages in toModelMessage
2a40354
@rekram1-node
rekram1-node merged commit 13f89fd into anomalyco:dev Nov 28, 2025
shuv1337 pushed a commit to shuv1337/shuvcode that referenced this pull request Nov 29, 2025
@Tarquinen @shuv1337
fix: filter empty messages in toModelMessage (anomalyco#4811)
0738dbd
@Tarquinen
Tarquinen deleted the fix/filter-empty-messages branch December 16, 2025 17:04
@coleleavitt coleleavitt mentioned this pull request Dec 29, 2025
fix: filter messages with only step-start parts in toModelMessage #6383
Merged
@altendky altendky mentioned this pull request Mar 9, 2026
fix(provider): skip empty-text filtering for assistant messages in normalizeMessages (#16748) #16750
Closed
3 of 6 tasks
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@Tarquinen
fix: filter empty messages in toModelMessage (anomalyco#4811)
cdb146f
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@Tarquinen
fix: filter empty messages in toModelMessage (anomalyco#4811)
98b54a4
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@Tarquinen
fix: filter empty messages in toModelMessage (anomalyco#4811)
a4d9a05
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@Tarquinen
fix: filter empty messages in toModelMessage (#4811)
f3c10be
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@Tarquinen
fix: filter empty messages in toModelMessage (anomalyco#4811)
cc7a8a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Tarquinen @rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.