Skip to content

Accept cloud environments without a pinned docker image#13672

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

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

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Description

The client rejected cloud environments whose stored JSON has no docker_image field: AmbientAgentEnvironment.base_image was a required, flattened BaseImage enum, so deserialization failed when the key was absent and the environment silently failed to load.

This PR makes base_image an Option<BaseImage> (still #[serde(flatten)]), so:

  • Environments without a pinned docker image now deserialize with base_image: None (serde's flattened-Option handling yields None when no variant key is present).
  • The wire format for environments that do pin an image is unchanged: a flat top-level docker_image key, and None serializes to no key at all.

Consumers updated to handle the absent image:

  • warp agent environment CLI (list/get/update) prints/serializes the image only when present ("None" in tables/details).
  • Settings → Environments list/edit form omit the "Image:" detail when unset.
  • Conversation details panel only renders/copies the Image field when present.
  • Environment picker sidecar shows "(none)" when no image is pinned.

Linked Issue

N/A — client-side deserialization fix.

Testing

  • Added unit tests in crates/cloud_object_models/src/cloud_environment_tests.rs:
    • deserializing an environment without docker_image succeeds with base_image: None
    • serializing base_image: None omits the docker_image key
    • serializing a pinned image preserves the exact flat docker_image wire format
    • roundtrip without a docker image
  • cargo test -p cloud_object_models — all pass
  • cargo clippy -p cloud_object_models --all-targets --all-features --tests -- -D warnings — clean
  • cargo clippy -p warp --all-targets -- -D warnings — clean
  • cargo check -p warp --lib — compiles
  • ./script/format — run

Agent Mode

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

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