Skip to content

Scope /ai/transcribe to the window's team - #15554

Merged
IsaiahWitzke merged 2 commits into
masterfrom
factory/team-header-transcribe
Aug 26, 2026
Merged

Scope /ai/transcribe to the window's team#15554
IsaiahWitzke merged 2 commits into
masterfrom
factory/team-header-transcribe

Conversation

@warp-agent-staging

Copy link
Copy Markdown
Contributor

Summary

Scopes POST /ai/transcribe (voice-input transcription) to the window's team by sending X-Warp-Team-Uid, following the pattern landed for /ai/multi-agent in #15355.

Without the header, the server falls through GetActiveTeamOrFallbackToPrincipalGetTeamForPrincipal, which resolves to whichever team has the lowest id — not necessarily the team the user has selected in that window. Server-side, transcribe.go uses the resolved team for cost denial, billing, and workspace settings, so an unscoped call can silently apply the wrong team's policy.

Changes

  • Transcriber::transcribe and its only implementation (ServerVoiceTranscriber) now take a RequestTeamScope.
  • ServerApi::transcribe sets X-Warp-Team-Uid from that scope (server-side handling already exists via SetActiveTeamFromHeader on /ai/*, so no server change is needed).
  • The one call site, EditorView::handle_voice_session_result, captures the scope from its ViewContext (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-agent wiring); no new business logic to unit test. Verified with:

  • ./script/format
  • cargo clippy -p warp --lib --tests -- -D warnings
  • cargo check -p warp --lib

I did not have a live warp-server + client environment available to manually exercise the voice-input flow end-to-end.

@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation View on Slack

Comment thread app/src/editor/view/voice.rs Outdated
- 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
IsaiahWitzke enabled auto-merge (squash) August 26, 2026 04:15
@IsaiahWitzke
IsaiahWitzke merged commit 8cc4e2f into master Aug 26, 2026
28 checks passed
@IsaiahWitzke
IsaiahWitzke deleted the factory/team-header-transcribe branch August 26, 2026 04:34
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>
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