Skip to content

TUI: Align shell completions with GUI - #14600

Open
moirahuang wants to merge 2 commits into
masterfrom
moira/tab-completions
Open

TUI: Align shell completions with GUI#14600
moirahuang wants to merge 2 commits into
masterfrom
moira/tab-completions

Conversation

@moirahuang

@moirahuang moirahuang commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Align Warp Agent CLI shell Tab completions with the desktop app while keeping rendering and editor ownership frontend-specific.

  • Warm PATH executables, shell functions, and builtins after the active TUI session bootstraps, including late-subscriber and defensive retry paths.
  • Share native-completion eligibility and Warp/native arbitration between GUI and TUI. Warp spec results win when non-empty; supported native-shell completions are used when Warp is empty or native completion is forced.
  • Share presentation-neutral suggestion ordering, filtering, common-prefix insertion, and explicit-Tab decisions through warp_completer.
  • Keep GUI-only classic/as-you-type behavior, autosuggestions, pixel rendering, and editor snapshots separate from TUI-only cell-grid rendering, menu acceptance, and stale-request guards.
flowchart LR
  Bootstrap["Shell bootstrapped"] --> GUILifecycle["GUI lifecycle"]
  Bootstrap --> TUILifecycle["TUI lifecycle"]
  GUILifecycle --> Warm["Shared Session loaders<br/>PATH, functions, builtins"]
  TUILifecycle --> Warm

  GUIInput["GUI request state"] --> Policy["Shared source policy<br/>and coordinator"]
  TUIInput["TUI request state"] --> Policy
  Policy --> Warp["warp_completer<br/>spec and command results"]
  Policy --> Native["Shared PTY native-shell protocol"]
  Warp --> Decision["Shared SuggestionResults<br/>ordering and Tab decision"]
  Native --> Decision
  Decision --> GUIOnly["GUI-only presentation<br/>pixel menu, classic/as-you-type,<br/>autosuggestions, editor snapshots"]
  Decision --> TUIOnly["TUI-only presentation<br/>cell-grid menu, acceptance,<br/>stale-request guards"]
Loading

Linked Issue

N/A

Testing

  • Manually tested locally with ./script/run-tui
    • laz<Tab> resolves to the PATH executable lazygit
    • brew<Tab><Tab> opens Homebrew subcommand completions
    • Forced native zsh completion with a startup-defined compdef fixture replaces warp-native-fixture war with the native-only warp-native-only-candidate; no filesystem fallback appears
  • cargo test -p warp_completer presentation_tests — 6 passed
  • cargo test -p warp completer::completion_source::tests — 3 passed
  • cargo test -p warp terminal::input::tests::test_tab_completion — 21 passed
  • cargo test -p warp_tui completion — 13 passed
  • ./script/format
  • cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings
  • cargo clippy -p warp --all-targets --tests -- -D warnings
  • cargo clippy -p warp_completer --all-targets --tests -- -D warnings
  • git diff --check
  • Full warp_tui suite attempted: 940/944 tests passed serially; four order-dependent handoff tests failed, while representative failures passed independently. A parallel run was limited by macOS file-descriptor exhaustion.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed Warp Agent CLI Tab completions missing desktop completion sources and supported native-shell fallback.
CHANGELOG-TUI: Shell Tab completions now share desktop ordering and native fallback behavior.

Plan: https://staging.warp.dev/drive/notebook/rluzUCwwgxGWekoP9qqBF8

Conversation: https://staging.warp.dev/conversation/9418539a-0a37-44cf-a359-ab9bd38668dd

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR warms TUI shell completion sources after session bootstrap by subscribing to SessionsEvent::SessionBootstrapped, adding a late-subscriber warm-up guard, and testing external command loading through the TUI helper. I did not find a concrete code correctness issue or security concern in the changed diff.

Concerns

  • This is a user-facing TUI completion behavior change, but the PR description only lists textual manual-test notes. Per the repo's TUI visual-evidence guidance, please attach a terminal transcript, render_to_lines / TuiBuffer::to_lines snapshot diff, or ./script/run-tui capture demonstrating the Tab completion behavior end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@moirahuang
moirahuang force-pushed the moira/tab-completions branch from c8c7041 to 2efd5ea Compare August 1, 2026 04:46
@moirahuang moirahuang changed the title TUI: Warm shell completion sources after bootstrap TUI: Align shell completions with GUI Aug 1, 2026
moirahuang and others added 2 commits July 31, 2026 22:23
Co-Authored-By: Oz <oz-agent@warp.dev>
@moirahuang
moirahuang force-pushed the moira/tab-completions branch from 2efd5ea to 3510fcb Compare August 1, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant