Skip to content

Carry file bytes across the Deep Agents backend activity boundary - #124

Merged
brianstrauch merged 1 commit into
temporalio:mainfrom
cystema:fix-backend-bytes
Oct 20, 2026
Merged

brianstrauch merged 1 commit into
temporalio:mainfrom
cystema:fix-backend-bytes

Conversation

@cystema

@cystema cystema commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #118.

TemporalBackend sent upload_files content and returned download_files content through plain JSON. Text came back as str (so deepagents' MemoryMiddleware, which decodes what it downloads, never loaded a memory file), and bytes that are not valid UTF-8 failed to serialize.

  • dump_backend_result / load_backend_result now tag bytes as base64.
  • Backend op arguments go through the same pair, so uploads keep their bytes too. Arguments without bytes encode exactly as before, so legacy cache keys are unchanged.
  • New workflow test: uploads a text file and a PNG header, then downloads them (async and sync), with a backend that rejects anything but bytes.

make lint and make test pass in python/deepagents (93 passed). I also ran it against our app with our local workaround removed: our memory-file tests pass, and fail on main without this change.

TemporalBackend sent upload_files content and returned download_files
content through plain JSON, so bytes arrived as text, or failed to
serialize when they were not valid UTF-8. Tag bytes as base64 in
dump_backend_result/load_backend_result and run backend op arguments
through them too.

Fixes temporalio#118
@cystema
cystema requested a review from a team as a code owner October 20, 2026 18:16
@CLAassistant

CLAassistant commented Oct 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

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.

[Bug] deepagents: TemporalBackend turns file bytes into str, so memory files never load

3 participants