Accept cloud environments without a pinned docker image#13675
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Accept cloud environments without a pinned docker image#13675warp-dev-github-integration[bot] wants to merge 1 commit into
warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
`AmbientAgentEnvironment.base_image` was a flattened, required `BaseImage`
enum, so deserializing a cloud environment whose stored JSON omits the
`docker_image` field failed. The server can store environments that do not
pin a base image, so the client must load them.
Make `base_image` an `Option<BaseImage>` with
`#[serde(default, flatten, skip_serializing_if = "Option::is_none")]`.
Environments without `docker_image` now deserialize to `None`, while
environments that pin an image keep the exact existing wire format
(`{"docker_image": "..."}`). Serializing an environment with no image omits
the key, so the format round-trips.
Update the call sites that read `base_image` for display or assignment to
handle the `Option`: the CLI `environment` command, the environments
settings page, the conversation details panel, and the environment
context-chip sidecar.
Add unit tests covering deserialization without `docker_image`, preservation
of other fields, omission on serialization, wire-format preservation when an
image is present, and round-trip.
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 Warp client failed to deserialize cloud environments whose stored JSON omits the
docker_imagefield.AmbientAgentEnvironment.base_imagewas a flattened, requiredBaseImageenum, so when thedocker_imagekey was absent serde could not match any enum variant and deserialization failed. The server can store environments that do not pin a base image, so the client must load them.This change makes
base_imageanOption<BaseImage>with#[serde(default, flatten, skip_serializing_if = "Option::is_none")]:docker_imagenow deserialize toNoneinstead of erroring.{"docker_image": "..."}) — the flattened enum behavior is unchanged.docker_imagekey, so the format round-trips.Call sites that read
base_imagefor display or assignment were updated to handle theOption: the CLIenvironmentcommand (environment get/list/update), the environments settings page, the conversation details panel, and the environment context-chip sidecar.Nonerenders as an empty/Nonedisplay string in those surfaces, matching how other optional fields are shown.Linked Issue
ready-to-specor `ready-to-implement.No linked issue — this is a deserialization robustness fix for server-stored cloud environments that lack a base image.
Testing
Added unit tests in
crates/cloud_object_models/src/cloud_environment_tests.rs:deserialize_environment_without_docker_image— an environment with nodocker_imagekey loads andbase_imageisNone.environment_without_docker_image_preserves_other_fields—description,code_forge,source_repos, andsecretsstill deserialize correctly whendocker_imageis absent.serialize_environment_without_docker_image_omits_field— serializing aNonebase image does not emit adocker_imagekey.serialize_environment_with_docker_image_preserves_wire_format— an environment with an image still serializes to a top-level"docker_image"string (not a nested object), preserving the existing wire format.roundtrip_serde_without_docker_image— serialize → deserialize is stable and the JSON contains nodocker_imagekey.Validation run locally:
cargo test -p cloud_object_models— 29 passed, 0 failed.cargo clippy -p cloud_object_models --all-targets --all-features --tests -- -D warnings— clean.cargo check -p warp --lib— clean../script/format --check— clean.cargo clippy -p warp --all-targets --tests -- -D warnings(CI default-features configuration) — clean.I have manually tested my changes locally with
./script/runScreenshots / Videos
Not applicable — no user-visible UI behavior change beyond no longer failing to load environments that lack a base image.
Agent Mode
CHANGELOG-BUG-FIX: Cloud environments that do not pin a docker image no longer fail to load in the Warp client.
Conversation: https://staging.warp.dev/conversation/4dd52438-2846-4326-bbd5-40866bdacaae
Run: https://oz.staging.warp.dev/runs/019f5d57-1af7-78a3-b386-bbaf841dcd0f
This PR was generated with Oz.