Skip to content

fix: preserve empty chat message fields#688

Open
lin-hongkuan wants to merge 1 commit into
ollama:mainfrom
lin-hongkuan:codex/preserve-empty-message-fields
Open

fix: preserve empty chat message fields#688
lin-hongkuan wants to merge 1 commit into
ollama:mainfrom
lin-hongkuan:codex/preserve-empty-message-fields

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • Preserve empty string and other falsy-but-valid chat message fields when normalizing messages.
  • Continue dropping only fields whose value is None.

Why

An explicitly empty content field is valid input in some chat/tool-call flows, but _copy_messages() previously removed it because it filtered on truthiness.

Testing

  • python -m pytest tests/test_client.py::test_client_chat_preserves_empty_message_content tests/test_client.py::test_client_chat -q
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant