Skip to content

fix(sdk): drop cached text when a binary write replaces it - #6534

Merged
VascoSch92 merged 1 commit into
OpenHands:mainfrom
yftx293:fix/filestore-bytes-stale-cache
Nov 6, 2026
Merged

VascoSch92 merged 1 commit into
OpenHands:mainfrom
yftx293:fix/filestore-bytes-stale-cache

Conversation

@yftx293

@yftx293 yftx293 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

HUMAN:

Fixed the stale cache read from #6348. I reviewed the diff and the test; a write must never leave a reader seeing the previous content.


AGENT:

Why

LocalFileStore.write caches text it writes, but the binary branch wrote the bytes and left the key's cached text in place. Overwriting a file that was cached as text with bytes therefore made the next read return the previous content, and the file on disk held the new bytes.

Summary

Issue Number

Part of #6348 (menu sub-item: "LocalFileStore.write(bytes) leaves the previous str cached, so a later read returns the old content")

How to Test

uv run pytest tests/sdk/io/test_filestore_cache.py -k bytes_overwrite

Before this change read returns the replaced text; after, it returns the bytes that were written. tests/sdk/io/ is 23 passed. ruff check/format on the touched files are clean.

Type

  • Bug fix

Notes

Binary content is still not cached; only the stale entry is removed.

@VascoSch92 VascoSch92 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.

thanks

@VascoSch92
VascoSch92 merged commit aa794a8 into OpenHands:main Nov 6, 2026
36 checks passed
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.

2 participants