Skip to content

fix(kosong): propagate message serialization options#2550

Open
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-1791-exclude-none
Open

fix(kosong): propagate message serialization options#2550
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-1791-exclude-none

Conversation

@lihailong00

@lihailong00 lihailong00 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • propagate Pydantic serialization options through Message.content
  • omit nested media id: null when providers call model_dump(exclude_none=True)
  • preserve default dumps, non-null IDs, and the single-text-part compatibility representation

Reproduction and verification

Before the fix, media parts and real OpenAI Legacy requests still contained nested id: null. After the fix:

  • message and provider snapshot tests — 43 passed
  • targeted Ruff and Pyright — passed

Closes #1791


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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

Labels

None yet

Projects

None yet

1 participant