Skip to content

[Feature]: 1-click clipboard import and unified auth choice for Cockpit Tools #3998

Description

@agentHits

Area

Authentication and account pool

What are you trying to accomplish?

Enable users to import Google Antigravity account tokens from Cockpit Tools directly via clipboard (1-click paste) and provide a clean, unified authorization choice modal when connecting accounts, allowing seamless selection between personal Google OAuth and Cockpit Tools token import.

What prevents this today?

Currently, Cockpit Tools import only supports selecting a .json file from disk (gui/src/components/provider-workspace/ProviderAuthPanel.tsx). Users with token exports in their system clipboard have to manually save JSON files to their local disk before uploading.

Furthermore, clicking "Add account" on Google Antigravity immediately triggers browser-based Google OAuth redirect and subscription ToS risk warnings, providing no visible option or choice for users who manage accounts via Cockpit Tools exports, unless they navigate deep into provider settings.

What should OpenCodex do?

  1. Clipboard & Manual Paste for Cockpit Tools:

    • Add a 1-click "Paste from clipboard" action using navigator.clipboard.readText().
    • Automatically normalize single account objects ({ email, refresh_token }) into expected record arrays ([{ email, refresh_token }]) and sanitize trailing commas before API validation.
    • Provide an expandable manual text input (textarea) as a fallback when browser clipboard read access is denied or manually toggled.
  2. Unified Account Auth Choice Modal:

    • When clicking "Add account" (or "Login") for Google Antigravity, present an explicit choice modal (AccountAuthChoiceModal) with two clear options:
      • Standard personal browser login (Google OAuth)
      • Cockpit Tools Antigravity import (with official AGCT branding and clipboard/file actions)
    • Allow users to cancel or go back without getting stuck in OAuth warning dialogs.
  3. Reusable Cockpit Tools Card Component:

    • Extract the import interface into a shared, styled CockpitToolsCard component with var(--glass-rail) background and official AGCT branding.

Example usage or interface

In the Add Provider modal or Provider Settings for Google Antigravity:

Connect Google Antigravity
Choose how you want to connect your account:

1. Browser Login (Google OAuth)
   Standard personal account login through a Google browser window
   [ Log in via browser ]

2. Cockpit Tools Antigravity
   Import account tokens and subscriptions without browser login
   [ 📋 Paste from clipboard ]  [ From file ]  [ Paste text ]
   ● Local encryption: refresh tokens are stored only on this device

Alternatives or workarounds

  • Save Cockpit Tools JSON export to disk manually every time and select the file via file picker.
  • Navigate to the provider settings page manually to find the file-only import input.

Additional context

  • Tested across all 9 supported locales with 100% translation parity.
  • Unit and UI test coverage added in gui/tests/provider-account-import.test.tsx.
  • Rebased on the latest dev branch commit.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions