Add /connect-grok TUI slash command shortcut - #14759
Add /connect-grok TUI slash command shortcut#14759warp-agent-staging[bot] wants to merge 2 commits into
Conversation
Add a `/connect-grok` TUI slash command that jumps straight into the Grok (xAI) connection flow, previously reachable only via `/api-keys` -> "X premium or SuperGrok subscription". - New `SlashCommandKind::ConnectGrok` and a `CONNECT_GROK` `StaticCommand` (TuiOnly, AI_ENABLED, no argument), registered in the command list. - `TuiApiKeysMenuModel::open_and_connect_grok` opens the api-keys menu and reuses `edit_provider(Xai)` so already-connected and policy-gated cases surface the same messaging as the existing provider row. - TUI dispatch arm records the standard slash-command acceptance telemetry. Co-Authored-By: Warp Agent <agent@warp.dev>
There was a problem hiding this comment.
Overview
Adds a /connect-grok TUI slash command (TuiOnly, AI_ENABLED) that reuses the existing edit_provider(Xai) path to jump straight into the Grok connect flow. The code is correct, well-scoped, and well-tested, but the user-facing change lacks the spec-required live-UI visual proof, so it cannot be accepted as-is.
Concerns
Live-UI visual proof is missing for a user-facing TUI change (acceptance criteria + factory-verification require it). The running TUI is genuinely login-gated in the automation sandbox — the PR's own captured recording/screenshots show a "Login failed" screen and a device-login browser prompt, and connecting Grok additionally requires an external X/xAI OAuth — so neither the implementation agent nor this review could reach the composer to capture the rendered command or the Grok launch. This is not implementation-addressable in the current environment; a human on a signed-in TUI build must confirm the /connect-grok menu entry renders with its description and that executing it launches the Grok connect flow (matching /api-keys → "X premium or SuperGrok subscription"), including the already-connected / policy-gated messaging. The deterministic tests below cover registration, dispatch, and equivalence-to-the-Grok-row, but do not substitute for the required visual confirmation.
Verdict
Checks: build ✅ · tests ✅ (3 new regression tests pass locally) · fmt+clippy ✅ (touched crates) · CI ⏳ (core jobs pending, none red) · visual proof ❌ (login-gated sandbox)
Found: 0 critical, 1 important (missing visual proof), 0 suggestions
Request changes
Review run
https://oz.staging.warp.dev/runs/019fd499-90ce-7cf7-87cf-20c00a9b2203
Summary
Adds a
/connect-grokTUI slash command that acts as a shortcut into the Grok (xAI) account connection flow. Today that flow is only reachable via/api-keys→ selecting the "X premium or SuperGrok subscription" row; this command jumps straight there.What changed:
SlashCommandKind::ConnectGrokvariant and aCONNECT_GROKStaticCommand(TuiOnly,AI_ENABLED, no argument, description "Connect your Grok (X Premium / SuperGrok) account"), registered in the command list so it is discoverable via the slash-command fuzzy filter.TuiApiKeysMenuModel::open_and_connect_grokopens the inline api-keys menu and reuses the existingedit_provider(LLMProvider::Xai)path, so the already-connected case and every policy gate (SuperGrok flag / BYOK enabled / org allows member keys) surface the exact same messaging as selecting the Grok provider row.SlashCommandKind::ConnectGrokdispatch arm in the TUIexecute_tui_slash_commandthat records the standard slash-command acceptance telemetry.ConnectGrokin its TUI-only bucket (the command is TUI-only).Per the ticket's non-blocking UX note,
/connect-grokimmediately initiates the connect (equivalent to selecting the Grok row) rather than merely pre-focusing it, reusingedit_provider(Xai)so the already-connected / policy-gated cases are handled identically.Verification
Deterministic checks (all pass):
./script/format, andcargo clippy -p warp -p warp_tui --tests -- -D warnings(clean on the touched crates).Regression tests added (all pass via
cargo nextest):connect_grok_command_is_tui_only_and_has_no_arguments(app/.../static_commands/commands_tests.rs) — asserts/connect-grokis registered TUI-only withAI_ENABLED, no argument, the expected description, and is absent from the GUI surface.open_and_connect_grok_matches_selecting_the_grok_row(crates/warp_tui/src/api_keys_menu_tests.rs) — asserts the shortcut lands in the identical menu state (open, same footer, same header) as opening the menu and selecting/accepting the Grok row, proving it reusesedit_provider(Xai).connect_grok_slash_command_opens_the_api_keys_menu_in_grok_flow(crates/warp_tui/src/terminal_session_view_tests.rs) — asserts executing/connect-grokopens the api-keys menu (ApiKeys suggestions mode) and clears the input.Note on the full test suite: only the touched packages/modules were run locally; the PR's CI is the full-suite backstop. A pre-existing
clippy::let_and_returnlint in the untouchedwarp_completercrate surfaces only under--all-features -D warningsand is unrelated to this change (confirmed reproducible on cleanmaster).Visual proof — outstanding (running UI could not be exercised)
This is a user-facing TUI change, so live-UI visual proof is expected. The TUI binary built successfully, but the running app is hard-gated behind a Warp account browser sign-in that cannot be completed in this sandbox (no OS keyring / Secret Service, and the environment's pending API key fails ID-token fetch), so the composer — and therefore the
/connect-grokmenu and Grok flow — could not be reached. The attached recording/screenshots document this login gate. The three deterministic tests above cover the command's registration, dispatch, and equivalence-to-the-Grok-row behavior; a reviewer with a signed-in TUI build should confirm the rendered/connect-grokmenu entry and Grok connect launch.CHANGELOG-IMPROVEMENT: Add a
/connect-grokTUI slash command that jumps straight into connecting your Grok (X Premium / SuperGrok) account.Originating thread: https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785973349809639
Computer-use video recordings
Launching Warp TUI and hitting login gate: Launches ./target/debug/warp-tui-oss with the exact command, showing the initial login screen that fails with an unexpected error, then retrying which requires a browser sign-in — the app is login-gated so the composer and /connect slash-command menu cannot be reached.
Computer-use screenshots (2)
The Warp TUI's initial login-gated screen showing "Login failed: unexpected error occurred when" with a Retry login option — no composer is reachable.
After retrying, the TUI shows a browser device-login prompt (app.warp.dev/device?user_code=...), confirming the app is login-gated and cannot proceed to the composer/slash-command menu without a Warp account sign-in.
Conversation: https://staging.warp.dev/conversation/157ffbbb-4e64-4030-9a03-5485949514f2
Run: https://oz.staging.warp.dev/runs/019fd458-9746-7e7c-b3d0-3074cdb1952d
This PR was generated with Oz.