Skip to content

fix(message): preserve base64 files in platform message chains - #188

Open
To3akaRin wants to merge 1 commit into
langbot-app:mainfrom
To3akaRin:codex/provider-base64-file-messages-2733
Open

To3akaRin wants to merge 1 commit into
langbot-app:mainfrom
To3akaRin:codex/provider-base64-file-messages-2733

Conversation

@To3akaRin

Copy link
Copy Markdown

Provider messages define ContentElement.file_base64, but both Message and MessageChunk omit it when building a platform message chain. A Runner can return a valid inline file through message.delta or message.completed and the file is silently discarded before an adapter receives it.

Add the missing conversion to File(base64=..., name=...) in both paths. Preserve content order and the original payload, retain empty files, skip missing payloads consistently with adjacent media branches, and use the platform model's empty-name default when the optional filename is absent.

Refs langbot-app/LangBot#2733. LangBot's pinned SDK must adopt a release containing this fix before running installations receive the behavior.

Regression coverage

23 parameterized cases cover full and streaming messages, binary and empty files, Unicode/optional names, mixed content order, first-text prefixes, file-only prefixes, Host attachments, input immutability, and JSON round-trips through message.delta, message.completed, and run.completed.

The unchanged baseline produced 21 failures and 2 passes in these tests. After the fix, all 23 cases and the related 98-test entity/Runner set passed.

Validation

  • Linux ARM64 / Python 3.12.12: 2,005 passed, 7 skipped, 84.75% coverage, above the repository's 84% gate.
  • Installed-wheel CLI/package black-box suite: 5 passed.
  • Full Ruff lint and format checks, scoped Mypy (38 files), and action-protocol consistency check passed.
  • sdist and wheel builds passed; both contain the exact tested production source.
  • Independent review found no blocking issues.

The macOS full run had 2,002 passes and one pre-existing failure: a runtime FD test reads Linux-only /proc/self/fd. The same failure reproduced in an unmodified 01533c4 worktree; the complete Linux run passed it. Environment-dependent skips remain visible in the validation record.

See the usage and regression guide. Actual WeCom delivery was not exercised; this change verifies SDK conversion and Runner serialization without changing platform APIs, wire fields, dependencies, or release versions.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. ✅ 所有贡献者均已签署 CLA。
Posted by the CLA Assistant Lite bot.

@To3akaRin

To3akaRin commented Oct 22, 2026 •

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@To3akaRin

Copy link
Copy Markdown
Author

recheck

dadachann added a commit to langbot-app/cla that referenced this pull request Oct 22, 2026
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