Skip to content

[multi-team P2] Scope LLM host settings to the window's team - #15447

Merged
IsaiahWitzke merged 10 commits into
masterfrom
factory/multi-team-p2-llm-host
Aug 27, 2026
Merged

[multi-team P2] Scope LLM host settings to the window's team#15447
IsaiahWitzke merged 10 commits into
masterfrom
factory/multi-team-p2-llm-host

Conversation

@warp-agent-staging

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

Copy link
Copy Markdown
Contributor

Summary

Scopes the AWS Bedrock and Gemini Enterprise host settings accessors to the window's team, continuing the multi-team migration. Rebased directly onto master (84d3e332), which landed the TeamScope/TeamContext machinery (#15443), the user_workspaces module split (#15485), and the scoped member-BYO getters (#15446) since this PR was last updated. The previous pre-#15443 implementation (its own scope plumbing) has been replaced with a fresh implementation built on the now-canonical TeamScope pattern.

Changes

  • Moved the AWS Bedrock / Gemini Enterprise host settings accessors from user_workspaces/mod.rs into user_workspaces/team_workspace_settings.rs, alongside the other team-scoped accessors: aws_bedrock_host_settings, gemini_enterprise_host_settings, is_{aws_bedrock,gemini_enterprise}_available_from_workspace, {aws_bedrock,gemini_enterprise}_host_enablement_setting, is_{aws_bedrock,gemini_enterprise}_credentials_{toggleable,enabled}.
  • Each now takes a TeamScope as a required argument instead of reading current_workspace() ambiently. The no-team arm follows the exact three-case shape already on master's team_byo_for_scope (no teams → workspace settings, exactly one team → that team's settings, more than one → deny), since llm_settings lives on both WorkspaceSettings and TeamSettings.
  • Added windowless "any-team" aggregates (is_aws_bedrock_credentials_enabled_for_any_team, gemini_enterprise_host_for_any_enabling_team) for background work with no window to resolve a team from: local AWS credential loading, background GEAP token refresh, and the "any usable BYO path" check. A conflicting GEAP configuration across teams reports Conflicting rather than picking one team's Google Cloud project arbitrarily.
  • Threaded scope through call sites that have a window or operation scope: RequestParams::new (agent request construction), the model picker/menu host icons, and the Warp Agent settings page's AWS Bedrock / Gemini Enterprise widgets (which now carry their own WeakViewHandle to resolve a scope in should_render/render).

Verification

  • ./script/format --check and cargo clippy -p warp --all-targets --tests -- -D warnings (and -p warp_tui) pass with no warnings.
  • cargo nextest run -p warp (full suite): 6595 passed, 3 failed, 7 skipped. The 3 failures (ambient_agent_headers_for_task_overrides_existing_cloud_agent_header, test_decorations_with_multibyte_chars, test_histignorespace_support_in_zsh) are pre-existing and unrelated to this change — confirmed by reproducing them identically on unmodified master (they fail on sandbox nsc isolation restrictions and pre-existing multibyte/zsh handling, both unrelated to team scoping).
  • Updated the existing AWS Bedrock / Gemini Enterprise unit tests in user_workspaces_tests.rs and geap_credentials_tests.rs for the new scoped signatures, and added regression tests pinning the no-team arm for a user with multiple teams (aws_bedrock_availability_denies_a_multi_team_users_teamless_window, gemini_enterprise_availability_denies_a_multi_team_users_teamless_window), which assert that a teamless window does not inherit any team's (or an ambient workspace value's) host policy when the user belongs to more than one team.

@cla-bot cla-bot Bot added the cla-signed label Aug 22, 2026
@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review August 22, 2026 09:01
@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

@warp-agent-staging
warp-agent-staging Bot force-pushed the factory/multi-team-p2-llm-host branch 2 times, most recently from 732d313 to faa4066 Compare August 24, 2026 06:27
Comment thread app/src/workspaces/user_workspaces/team_workspace_settings.rs Outdated
@warp-agent-staging
warp-agent-staging Bot force-pushed the factory/multi-team-p2-llm-host branch from 894b6a9 to 6d37bc9 Compare August 24, 2026 21:16
@warp-agent-staging
warp-agent-staging Bot force-pushed the factory/multi-team-p2-llm-host branch from 6d37bc9 to 08c74ed Compare August 24, 2026 22:08
@IsaiahWitzke
IsaiahWitzke force-pushed the factory/multi-team-p2-llm-host branch from 049cb04 to db599ff Compare August 26, 2026 03:53
Comment thread app/src/ai/blocklist/controller/response_stream.rs
Comment thread app/src/ai/geap_credentials.rs
warp-agent-staging Bot and others added 8 commits August 26, 2026 16:51
Threads TeamScope through the AWS Bedrock and Gemini Enterprise host
settings accessors (aws_bedrock_host_settings, gemini_enterprise_host_settings,
is_{aws_bedrock,gemini_enterprise}_available_from_workspace,
{aws_bedrock,gemini_enterprise}_host_enablement_setting,
is_{aws_bedrock,gemini_enterprise}_credentials_{toggleable,enabled}), moving
them from app/src/workspaces/user_workspaces/mod.rs into
team_workspace_settings.rs alongside the other team-scoped accessors.

Windowless background work (local AWS credential loading, background GEAP
token refresh, and the 'any usable BYO path' check) uses new any-team
aggregates (is_aws_bedrock_credentials_enabled_for_any_team,
gemini_enterprise_host_for_any_enabling_team) instead, since that code has
no window to resolve a team from.

Call sites that do have a window or an operation scope now thread it through:
agent request construction, the model picker/menu icons, and the Warp Agent
settings page's AWS Bedrock / Gemini Enterprise widgets.

Rebased directly onto master (84d3e33), reimplementing the scoping using
the TeamScope/TeamContext machinery from #15443 rather than reviving this
PR's pre-#15443 approach.
The geap_credentials module (its only caller) is already cfg(not(wasm)),
so GeminiEnterpriseBackgroundHost and
gemini_enterprise_host_for_any_enabling_team were dead code on wasm,
which -D warnings turns into a hard clippy failure on that target.
team_byo_for_scope, default_host_slug, and get_agent_attribution_setting
already route through the shared scoped_or_workspace_setting helper
landed by #15445. llm_settings_for_scope (the base of the Bedrock and
Gemini Enterprise host-settings chains) still spelled its own no-team
arm as a three-case match, denying a teamless scope whenever the user
was on more than one team. Convert it to the helper so a teamless scope
reads current_workspace().settings unconditionally, matching every
other scoped accessor.

Update the two tests that pinned the old three-case denial for a
multi-team user's teamless window; they now pin the workspace-settings
fallback instead. The existing
member_byo_policy_denies_a_scope_naming_an_unresolvable_team test
already covers the fence that a scope naming an unresolvable team must
still get `absent`, not another team's value -- that fence is
unchanged by this helper conversion.

The windowless any-team aggregates (is_aws_bedrock_credentials_enabled_for_any_team,
current_geap_policy_for_any_team, has_usable_byo_inference_path) are a
different shape -- they answer for the union of a user's teams for
background work with no window -- and still have no window in reach at
their call sites, so they are left as-is.
Co-Authored-By: Warp <agent@warp.dev>
…m names

- Comment 1 (response_stream.rs:626): already resolves through
  current_geap_policy_for_any_team (the any-enabling-team path), not the
  window-scoped one -- confirmed unchanged since the PR's first commit.
  No code change; replying with evidence.
- Comment 2(a): current_geap_policy_for_any_team has 4 production call
  sites (refresh_geap_credentials_if_needed,
  refresh_geap_credentials_with_options, apply_geap_mint_result_inner,
  and the response_stream.rs mint-binding check), all of which need its
  GeapPolicy collapse. Kept; replying with the call site list.
- Comment 2(b): GeminiEnterpriseBackgroundHost::Conflicting now carries
  the names of every team that enables GEAP but disagrees on the
  project, threaded through GeapPolicy::Conflicting and a new
  GeapCredentialsState::ConflictingAcrossTeams, so the existing GEAP
  card in warp_agent_page.rs (already reading
  geap_credentials_state().user_facing_components()) surfaces a
  specific 'these teams disagree' message instead of the generic
  Unconfigured one. Team names are joined in prose, capped at two named
  teams with an '+N other teams' summary beyond that.
- Fixed two pre-existing compile issues from the prior session's 'Scope
  AI availability by team' commit: a scope passed by value instead of
  reference in GeminiEnterpriseWidget::is_refresh_enabled, and an
  unused TeamScope import.
Co-Authored-By: Warp <agent@warp.dev>
@IsaiahWitzke
IsaiahWitzke force-pushed the factory/multi-team-p2-llm-host branch from ad3f932 to 6c76720 Compare August 26, 2026 20:55
@IsaiahWitzke
IsaiahWitzke enabled auto-merge (squash) August 26, 2026 23:08
@IsaiahWitzke
IsaiahWitzke merged commit dcfad88 into master Aug 27, 2026
26 checks passed
@IsaiahWitzke
IsaiahWitzke deleted the factory/multi-team-p2-llm-host branch August 27, 2026 00:36
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.

2 participants