feat: name the account (personal or team) in whoami and login

Merged
SA
23d ago
+478-9

Name the account (personal or team) in whoami and login

InferenceInfra team accounts (https://github.com/RunanywhereAI/InferenceInfra/pull/6049) add an optional account {id, name, kind} to GET /v1/me. Console side: https://github.com/RunanywhereAI/Runanywhere-monorepo/pull/272.

BeforeAfter
wally account whoamiemail, session+ account Acme Labs (team) or account personal, only when the server sends one
whoami --jsonemail, session, console+ account {id, name, kind}, absent otherwise
wally account loginsigned in as you@xsigned in as you@x (Acme Labs (team)), from one best-effort /v1/me after the grant is saved
  • Compatibility both ways: no path or field renamed. An old server (no field) prints exactly what it did. An old CLI ignores the field (the generated parser reads named fields only). A display-unsafe name is dropped, never a failure.
  • Contract: re-vendored with contracts/sync_from_inferenceinfra.py from InferenceInfra feat/teams @ 810be26b. Re-sync from development once https://github.com/RunanywhereAI/InferenceInfra/pull/6049 merges.
  • No release in this PR (release with the next validated CLI release).

Validation

  • cargo fmt --check RC=0, cargo clippy --all-targets -D warnings RC=0.
  • ctest: 6/6 passed (wally_rust_tests, wally_account_cli_e2e with new team / --json / personal / login-line cases, help, decisions, harness). Configured locally with -DWALLY_APPLE_MLX_HOST=OFF (no SDK Swift tree on this machine); CI builds the full host.
  • Parse tests with and without the field (tests/test_wally_account.rs); break test: mapping neutered, 2 failed; restored, 3 passed.
  • tests/test_contract_sync.py OK, generate_console_binding.py --check OK, sync_from_inferenceinfra.py --check OK, check-agents-sync.sh OK.
  • Not run: a real wally login + whoami against the dev control plane with teams on. It needs https://github.com/RunanywhereAI/InferenceInfra/pull/6049 deployed and the flag flipped, neither in scope here.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Account identity now includes an optional account type, ID, and display name. The CLI shows available account details in whoami output, including JSON, and identifies the approved account during sign-in.
    • The API contract documents account types, team-related errors, and rate-limit responses.
  • Bug Fixes

    • Missing or unusable account details no longer prevent identity information from being retrieved. Accounts without a valid type are treated as absent.