Skip to content

Implement auth secret deletion from selector menu#11241

Draft
abhishekp106 wants to merge 2 commits into
masterfrom
oz/cloud-mode-auth-secret-deletion-spec
Draft

Implement auth secret deletion from selector menu#11241
abhishekp106 wants to merge 2 commits into
masterfrom
oz/cloud-mode-auth-secret-deletion-spec

Conversation

@abhishekp106
Copy link
Copy Markdown
Contributor

@abhishekp106 abhishekp106 commented May 18, 2026

Summary

  • Adds a right-aligned X affordance on each Warp-managed secret row in the ambient auth selector chip menu (non-Oz cloud harnesses)
  • Wires deletion through HarnessAvailabilityModel::delete_auth_secret with new AuthSecretDeleted / AuthSecretDeletionFailed events
  • Clears the chip selection and persisted last_selected_auth_secret when the deleted secret was the active one
  • Shows success/failure toasts and drops duplicate delete clicks while a request is in flight

Implements the behavior described in specs/cloud-mode-auth-secret-deletion/PRODUCT.md and TECH.md on this branch.

Key changes

  • app/src/ai/harness_availability.rs: AuthSecretEntry now carries SecretOwner (mapped from the GraphQL Space); delete_auth_secret calls ManagedSecretManager::delete_secret, updates the cache, and emits the new events.
  • app/src/menu.rs: opt-in right-side icon action on MenuItemFields. Clicking the right-side icon dispatches a separate action via its own Hoverable, suppressing the row's click. Existing decorative with_right_side_icon callers are unchanged.
  • app/src/terminal/view/ambient_agent/auth_secret_selector.rs: tracks pending_deletes, renders the X on managed-secret rows only, handles DeleteSecret, and reacts to AuthSecretDeleted / AuthSecretDeletionFailed.
  • All existing HarnessAvailabilityEvent match sites (FTUX dropdown, FTUX view, model selector, orchestration config block, run-agents card) updated to remain match-exhaustive; Deleted refreshes pickers so the secret disappears across surfaces.
  • crates/managed_secrets/src/client.rs: SecretOwner now derives PartialEq, Eq, Hash so it can ride along on the selector's PartialEq action enum.

Test plan

  • Open the auth selector chip menu with multiple secrets; confirm only existing secret rows show a right-aligned X (no X on header, "Inherit", "New", loading/error, or sidecar rows)
  • Delete an unselected secret; confirm it disappears and a success toast appears
  • Delete the currently selected secret; confirm the chip falls back to the inherit label and the persisted selection is cleared
  • Force a failure (offline / unauthenticated); confirm the row remains, current selection is unchanged, and a failure toast appears
  • Click X repeatedly while a delete is pending; confirm only one request fires
  • Confirm clicking the X does not also select the row

This PR was created by Oz (running Claude Code).

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 18, 2026
Adds a right-aligned X button on each Warp-managed secret row in the auth
selector chip menu (non-Oz cloud harnesses). Clicking it deletes the
secret via ManagedSecretManager, surfaces a success or failure toast,
and clears the selection (and persisted last-selected) when the deleted
secret was the active one. Duplicate clicks while a delete is in flight
are dropped.

- Extends AuthSecretEntry with SecretOwner so per-secret deletes use the
  correct ownership scope (User vs Team) rather than guessing at click
  time.
- Adds HarnessAvailabilityModel::delete_auth_secret plus
  AuthSecretDeleted / AuthSecretDeletionFailed events, and updates all
  match-exhaustive subscribers (FTUX, model selector, orchestration
  pickers, run-agents card) to refresh on Deleted.
- Adds an opt-in right-side action hit target to MenuItemFields so the
  X dispatches a separate action and stops the row's select click from
  firing alongside it. Existing right-side icons remain decorative.
- Derives PartialEq/Eq/Hash on SecretOwner so it can ride along on the
  selector's PartialEq action enum.

Co-Authored-By: Oz <oz-agent@warp.dev>
@abhishekp106 abhishekp106 changed the title Add auth secret deletion specs Implement auth secret deletion from selector menu May 18, 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