refactor: unify environment hashing on environment_content_hash#2190
Merged
kobe0938 merged 2 commits intoJul 5, 2026
Merged
Conversation
Contributor
|
Enjoy a better diff viewing experience by clicking one of these URLs: |
22867b5 to
8ea5501
Compare
8ea5501 to
5a1e859
Compare
Contributor
|
I think you can also let More details were considered in |
Collaborator
Author
Thanks for pointing out. Let's keep the |
Replace environment_template_hash (dirhash-based) and environment_dir_hash/_truncated with environment_content_hash, and remove the unused dockerfile_hash/dockerfile_hash_truncated pair. Providers now derive artifact names from environment_id (a prefix of the same digest), so environment_content_hash has a single caller: BaseEnvironment.environment_id. DaytonaSnapshotService receives the hash instead of computing it, and the unused _get_environment_hash / _get_auto_snapshot_name helpers are removed. Hash suffixes are standardized to SNAPSHOT_HASH_LEN = 12 characters (previously 8 for E2B, Novita, and Blaxel). Derived artifact names rotate once as a result: E2B/Novita template names, Blaxel image names, Daytona auto_snapshot names, and LangSmith Dockerfile snapshot names, so the first run after upgrading rebuilds each template/snapshot. environment_id, local Docker image tags, and user-provided snapshot/template names are unaffected. Transient files (.DS_Store, .git, __pycache__) no longer perturb cache names.
5a1e859 to
d1e9aec
Compare
alexgshaw
approved these changes
Jul 5, 2026
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.
Replace
environment_template_hash(dirhash-based) andenvironment_dir_hash/_truncatedwithenvironment_content_hash. Also remove the unuseddockerfile_hash/dockerfile_hash_truncatedpair as they are never used.Hash suffixes are truncated to 12 characters (previously 8 for E2B, Novita, and Blaxel). 12 is much safer than 8; also make them consistent with Daytona and langsmith, which is 12. set a constant for it SNAPSHOT_HASH_LEN