Skip to content

Accept cloud environments without a pinned docker image#13675

Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
fix/env-docker-image-optional
Draft

Accept cloud environments without a pinned docker image#13675
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
fix/env-docker-image-optional

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Description

The Warp client failed to deserialize cloud environments whose stored JSON omits the docker_image field. AmbientAgentEnvironment.base_image was a flattened, required BaseImage enum, so when the docker_image key 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_image an Option<BaseImage> with #[serde(default, flatten, skip_serializing_if = "Option::is_none")]:

  • Environments without docker_image now deserialize to None instead of erroring.
  • Environments with a pinned image keep the exact existing wire format ({"docker_image": "..."}) — the flattened enum behavior is unchanged.
  • Serializing an environment with no image omits the docker_image key, so the format round-trips.

Call sites that read base_image for display or assignment were updated to handle the Option: the CLI environment command (environment get/list/update), the environments settings page, the conversation details panel, and the environment context-chip sidecar. None renders as an empty/None display string in those surfaces, matching how other optional fields are shown.

Linked Issue

  • The linked issue is labeled ready-to-spec or `ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

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 no docker_image key loads and base_image is None.
  • environment_without_docker_image_preserves_other_fieldsdescription, code_forge, source_repos, and secrets still deserialize correctly when docker_image is absent.
  • serialize_environment_without_docker_image_omits_field — serializing a None base image does not emit a docker_image key.
  • 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 no docker_image key.

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/run

Screenshots / Videos

Not applicable — no user-visible UI behavior change beyond no longer failing to load environments that lack a base image.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI 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.

`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>
@cla-bot cla-bot Bot added the cla-signed label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant