Skip to content

Fix env edit: preserve server fields + show source_repos repos in form#13677

Draft
liliwilson wants to merge 2 commits into
masterfrom
oz-agent/fix-env-without-docker-image-updates
Draft

Fix env edit: preserve server fields + show source_repos repos in form#13677
liliwilson wants to merge 2 commits into
masterfrom
oz-agent/fix-env-without-docker-image-updates

Conversation

@liliwilson

Copy link
Copy Markdown
Contributor

Description

Followup to #13553 (which fixed deserialization of environments without a docker image). Two remaining client-side issues:

  1. UI edit form lost server-managed fields: When saving an environment via the edit form, a fresh AmbientAgentEnvironment was created from only the form fields, dropping secrets, providers, code_forge, and source_repos. Now we merge form changes into the existing environment model, preserving those fields.

  2. Repos not shown/saved for source_repos-based environments: The form initialized repos only from github_repos. Environments that store repos via the newer source_repos field showed an empty repo list, and any saves would leave repos stranded in source_repos (silently ignored by the server). Added effective_github_repos() helper that returns repos from source_repos (when all GitHub) or falls back to github_repos. The merge now also clears source_repos so the server uses github_repos as authoritative.

  3. Confusing "Image: " display: The environment list card always rendered Image: <empty> for environments without a docker image. Now the image row is omitted entirely when no image is set.

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 (especially for user-visible or UI changes).

Testing

  • cargo test -p cloud_object_models — all 27 tests pass.

  • cargo clippy -p cloud_object_models and cargo clippy --lib -p warp — clean.

  • cargo check --lib -p warp — compiles.

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Conversation: https://staging.warp.dev/conversation/15acb581-7405-4c1e-852a-2d3007d38705
Run: https://oz.staging.warp.dev/runs/019f5d5a-a09d-716c-b670-8140359eca07

CHANGELOG-BUG-FIX: Fixed environment edit form losing server-managed fields (secrets, providers) and not showing repos from source_repos-based environments.

This PR was generated with Oz.

When editing an environment via the UI:
- Merge form changes into the existing environment model instead of
  creating a fresh one, preserving server-managed fields (secrets,
  providers, code_forge) that the form doesn't expose.
- Source_repos is cleared so the server falls back to github_repos
  (which the form now correctly populates from effective_github_repos).
- Init the repos field from effective_github_repos() so environments
  that store repos via source_repos show them in the edit form.
- Hide 'Image:' label on environment cards when no docker image is set.

These address remaining gaps after #13553 for environments without a
docker image: the form now correctly shows and saves their repos.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jul 13, 2026
The server uses source_repos as the authoritative repo list when
present. When updating only github_repos (the legacy field) while
source_repos is non-nil in the payload, the server ignores github_repos
and the changes are silently dropped.

Use effective_github_repos() to compute the canonical list (reading
from source_repos when set), apply adds/removes to it, write back to
github_repos, and clear source_repos so the server falls back to
github_repos as authoritative.

This is the root cause of David's reported issue where CLI repo updates
appeared to succeed but repos were not present on re-fetch.

Co-Authored-By: Oz <oz-agent@warp.dev>
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