Add workflow payload compression encoder#526
Open
lucasmrdt wants to merge 16 commits into
Open
Conversation
4e2aad7 to
54fb520
Compare
d202362 to
d391c9f
Compare
d391c9f to
f1d8248
Compare
HHK1
reviewed
May 19, 2026
f1d8248 to
db1cf64
Compare
HHK1
reviewed
May 19, 2026
| return data, encoding_options | ||
| return data, encoding_options, encoding_metadata | ||
|
|
||
| async def encode_event_payload_content( |
There was a problem hiding this comment.
This is only used in tests as far as I can tell, what is this for?
Author
There was a problem hiding this comment.
Good catch — this helper was only used by the test. I removed it and the test, and cleaned up a couple of nearby compression-only leftovers.
Contributor
There was a problem hiding this comment.
It's about event encoding, it's not YET used but will be very soon so please don't delete that
db1cf64 to
a466079
Compare
HHK1
reviewed
May 19, 2026
* Wrap compressed workflow payloads * Clean up workflow compression tests * Use compressed payload helper in tests --------- Co-authored-by: Vibe Nuage Agent <vibe@mistral.ai>
TEMPORARY: enable PayloadCompressionConfig by default in WorkflowEncodingConfig so compression is active without env var wiring. Revert once validated and proper WorkerConfig plumbing is in.
* Use msgpack for compressed workflow payloads * Merge _require_msgpack with _require_zstandard pattern - Move _require_msgpack from payload_encoder.py to payload_compressor.py - Use import_module from importlib instead of __import__ - Return ModuleType instead of Any for consistency - Keep compression-related imports together in one place This consolidates the module import helpers for compression libraries (zstandard and msgpack) in a single location for better maintainability. * Make msgpack a core dependency --------- Co-authored-by: Vibe Nuage Agent <vibe@mistral.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Checks
uv run python -m pytest src/mistralai/extra/tests/test_workflow_encoding.py -quv run ruff check src/mistralai/extra/workflows/encoding/models.py src/mistralai/extra/workflows/encoding/payload_encoder.py src/mistralai/extra/tests/test_workflow_encoding.pyuv run ruff format --check src/mistralai/extra/workflows/encoding/models.py src/mistralai/extra/workflows/encoding/payload_encoder.py src/mistralai/extra/tests/test_workflow_encoding.pyCI note
.github/workflows/run_example_scripts.yaml.run_examplesfailures on this PR showedMISTRAL_API_KEY:empty in the job environment, followed byhttpx.LocalProtocolError: Illegal header value b'Bearer '. That points to examples running without the CI API-key secret, not to the workflow compression code.mainrun_examplesruns pass withMISTRAL_API_KEY: ***present; an oldermainfailure on 2026-05-06 had the secret present and failed later for a different example issue.