Accept cloud environments without a pinned docker image#13672
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Accept cloud environments without a pinned docker image#13672warp-dev-github-integration[bot] wants to merge 1 commit into
warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
Cloud environments stored without a docker_image key previously failed client-side deserialization because AmbientAgentEnvironment's flattened BaseImage enum was required. Make base_image an Option<BaseImage> so environments that don't pin a docker image load correctly, while preserving the exact existing wire format (a flat top-level docker_image key) for environments that do. Update UI and CLI consumers to handle the absent image, and add unit tests covering deserialization, serialization omission, wire-format preservation, and roundtripping. Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Description
The client rejected cloud environments whose stored JSON has no
docker_imagefield:AmbientAgentEnvironment.base_imagewas a required, flattenedBaseImageenum, so deserialization failed when the key was absent and the environment silently failed to load.This PR makes
base_imageanOption<BaseImage>(still#[serde(flatten)]), so:base_image: None(serde's flattened-Optionhandling yieldsNonewhen no variant key is present).docker_imagekey, andNoneserializes to no key at all.Consumers updated to handle the absent image:
warp agent environmentCLI (list/get/update) prints/serializes the image only when present ("None" in tables/details).Linked Issue
N/A — client-side deserialization fix.
Testing
crates/cloud_object_models/src/cloud_environment_tests.rs:docker_imagesucceeds withbase_image: Nonebase_image: Noneomits thedocker_imagekeydocker_imagewire formatcargo test -p cloud_object_models— all passcargo clippy -p cloud_object_models --all-targets --all-features --tests -- -D warnings— cleancargo clippy -p warp --all-targets -- -D warnings— cleancargo check -p warp --lib— compiles./script/format— runAgent Mode
CHANGELOG-BUG-FIX: Fixed cloud environments without a pinned docker image failing to load in the client.
Conversation: https://staging.warp.dev/conversation/b6751d1c-549b-4a27-a268-5b864c2e9a7e
Run: https://oz.staging.warp.dev/runs/019f5d56-7653-71ca-976c-683147508672
This PR was generated with Oz.