Skip to content

remove agy <active-tank>: auto-switch to a sibling instead of refusing #23

@mixflavor

Description

@mixflavor

clikae remove agy <active-tank> currently refuses ("switch to another first"; v0.5.13 now names a concrete tank). UX option: auto-switch to a remaining tank (global ~/.gemini symlink + Keychain restore), then remove.

Tradeoff: removing the active tank becomes a global account switch (affects all terminals) — could surprise. Flips a tested behavior (tests/bats/antigravity.bats: "remove agy refuses the active tank while others remain").

Proposed diff (lib/commands/antigravity.sh, _agy_remove, where it log_fails on the active tank):

if [ "$name" = "$active" ]; then
  local _other; _other="$(_agy_tank_names | grep -vx "$name" | head -1)"
  _agy_kc_restore "$_other"; rm -f "$link"; ln -s "$slots/$_other" "$link"
  log_info "Switched active '$name' -> '$_other' (global) so it can be removed."
  active="$_other"
fi

Decision needed: is the global auto-switch desirable? If yes: implement + update the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions