Skip to content

Add /connect-grok TUI slash command shortcut - #14759

Open
warp-agent-staging[bot] wants to merge 2 commits into
masterfrom
factory/app-5200-connect-grok
Open

Add /connect-grok TUI slash command shortcut#14759
warp-agent-staging[bot] wants to merge 2 commits into
masterfrom
factory/app-5200-connect-grok

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a /connect-grok TUI 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:

  • New SlashCommandKind::ConnectGrok variant and a CONNECT_GROK StaticCommand (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_grok opens the inline api-keys menu and reuses the existing edit_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.
  • A SlashCommandKind::ConnectGrok dispatch arm in the TUI execute_tui_slash_command that records the standard slash-command acceptance telemetry.
  • The GUI dispatch match lists ConnectGrok in its TUI-only bucket (the command is TUI-only).

Per the ticket's non-blocking UX note, /connect-grok immediately initiates the connect (equivalent to selecting the Grok row) rather than merely pre-focusing it, reusing edit_provider(Xai) so the already-connected / policy-gated cases are handled identically.

Verification

Deterministic checks (all pass): ./script/format, and cargo 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-grok is registered TUI-only with AI_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 reuses edit_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-grok opens 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_return lint in the untouched warp_completer crate surfaces only under --all-features -D warnings and is unrelated to this change (confirmed reproducible on clean master).

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-grok menu 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-grok menu entry and Grok connect launch.

CHANGELOG-IMPROVEMENT: Add a /connect-grok TUI 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

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.
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.
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.
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.

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>
@cla-bot cla-bot Bot added the cla-signed label Aug 6, 2026
@warp-agent-staging warp-agent-staging Bot added the warpy-factory Label associated to the "Wob the Wuilder" factory on staging, also known as Warpy Factory. label Aug 6, 2026
@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review August 6, 2026 01:01

@warp-agent-staging warp-agent-staging Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Labels

cla-signed warpy-factory Label associated to the "Wob the Wuilder" factory on staging, also known as Warpy Factory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant