Scope /ai/transcribe to the window's team - #15554
Merged
Merged
Conversation
Contributor
Author
|
This PR was generated with Warp. Comment |
- Thread RequestTeamScope through the CLI-agent voice transcribe call site (gated behind the voice_input feature), which the OSS release channel compiles but the default feature set used for local validation did not. - Drop the two comments that only restated what the surrounding code already said.
IsaiahWitzke
approved these changes
Aug 26, 2026
IsaiahWitzke
enabled auto-merge (squash)
August 26, 2026 04:15
This was referenced Aug 26, 2026
MaggieShan
pushed a commit
that referenced
this pull request
Aug 26, 2026
… transcription (#15570) ## Description Fixes a compile error breaking every TUI release build (dev/preview/stable, all archs) in the scheduled `Cut New Releases` workflow. [PR #15554](#15554) ("Scope /ai/transcribe to the window's team") added a third `team_scope: RequestTeamScope` parameter to `Transcriber::transcribe` and updated the GUI call site (`EditorView::handle_voice_session_result`), but missed the TUI call site in `TuiVoiceInputModel::handle_session_result` (`crates/warp_tui/src/voice_input.rs`). That module is compiled only when the `voice_input` feature is enabled — which only the TUI release build does — so the mismatch escaped both `warp`'s and `warp_tui`'s normal CI. This PR threads a `RequestTeamScope` into the TUI call site the same way the GUI does: `UserWorkspaces::team_context_resolver` is captured from the owning `TuiInputView`'s `ViewContext` at construction time (when a window is still reachable) and stored on `TuiVoiceInputModel`, which only has a `ModelContext` by the time it needs to resolve the scope and spawn the transcription future off the main thread. ## Linked Issue No tracked issue — this is a release-blocking build break reported directly from a failing [GitHub Actions run](https://github.com/warpdotdev/warp-internal/actions/runs/32947105089/job/98111011998) in `warp-internal`. ## Testing - `cargo check -p warp_tui --bin warp-tui-oss --features release_bundle,standalone,voice_input` — passes. This mirrors the exact feature set `script/macos/bundle` (and the Linux/Windows equivalents) use to build the TUI release artifact. - `cargo clippy -p warp_tui --bin warp-tui-oss --features release_bundle,standalone,voice_input -- -D warnings` — passes. - `./script/format` — no changes needed. - Existing unit tests in `crates/warp_tui/src/voice_input_tests.rs` were updated for the new `TuiVoiceInputModel::new` parameter (using `UserWorkspaces::teamless_context_resolver_for_test()`, matching the existing pattern in `test_fixtures.rs`). I could not run `cargo test -p warp_tui --features voice_input,test-util` in this sandbox: that path enables `warpui_core/test-util` (via `warp/test-util` → `warp_terminal/test-util`) without `warpui`'s own, separately-declared `test-util` feature, which is what actually gates the `Delegate` impl blocks that provide `get_cursor_shape()` in `crates/warpui`. That feature-wiring mismatch between `warpui_core` and `warpui` (not a missing implementation, and not platform-specific — the macOS impl is gated the same way) makes the build fail with `E0046` (`not all trait items implemented: get_cursor_shape`). I confirmed this reproduces identically on unmodified `master` with the same feature flags, so it isn't caused by this change — flagging it since it also blocks running these tests in CI's `test-util` paths. (Filed a fuller writeup of this in #15575, a presubmit/CI-coverage follow-up.) **Presubmit coverage gap:** `script/presubmit` runs `cargo clippy --workspace --exclude warp_completer --all-targets --tests` and `cargo clippy -p warp --all-targets --tests`, neither with `--all-features` (explicitly disabled via a `TODO` comment) nor `--features voice_input`. Since `voice_input` is an opt-in, non-default feature on `warp_tui`, presubmit never compiles `voice_input.rs`. That's exactly how a green PR broke every TUI release build. Not fixed here per scope; filed as #15575. - [ ] I have manually tested my changes locally with `./script/run` (not applicable — headless TUI compile fix, no `warp-server`/device available to exercise a live transcription request in this environment) ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode <!-- warp:pr-description-artifacts start --> <!-- warp:pr-description-artifacts end --> Co-authored-by: warp-agent-staging[bot] <240773466+warp-agent-staging[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Scopes
POST /ai/transcribe(voice-input transcription) to the window's team by sendingX-Warp-Team-Uid, following the pattern landed for/ai/multi-agentin #15355.Without the header, the server falls through
GetActiveTeamOrFallbackToPrincipal→GetTeamForPrincipal, which resolves to whichever team has the lowest id — not necessarily the team the user has selected in that window. Server-side,transcribe.gouses the resolved team for cost denial, billing, and workspace settings, so an unscoped call can silently apply the wrong team's policy.Changes
Transcriber::transcribeand its only implementation (ServerVoiceTranscriber) now take aRequestTeamScope.ServerApi::transcribesetsX-Warp-Team-Uidfrom that scope (server-side handling already exists viaSetActiveTeamFromHeaderon/ai/*, so no server change is needed).EditorView::handle_voice_session_result, captures the scope from itsViewContext(UserWorkspaces::as_ref(ctx).team_context_for_view(ctx)) before the transcription future is spawned off the main thread, since no window is reachable once it's running.Verification
This is a header-plumbing change through an established pattern (
RequestTeamScope, mirroring the/ai/multi-agentwiring); no new business logic to unit test. Verified with:./script/formatcargo clippy -p warp --lib --tests -- -D warningscargo check -p warp --libI did not have a live warp-server + client environment available to manually exercise the voice-input flow end-to-end.