[multi-team P2] Scope LLM host settings to the window's team - #15447
Merged
Conversation
Contributor
Author
|
This PR was generated with Warp. Comment |
warp-agent-staging
Bot
force-pushed
the
factory/multi-team-p2-llm-host
branch
2 times, most recently
from
August 24, 2026 06:27
732d313 to
faa4066
Compare
IsaiahWitzke
requested changes
Aug 24, 2026
warp-agent-staging
Bot
force-pushed
the
factory/multi-team-p2-llm-host
branch
from
August 24, 2026 21:16
894b6a9 to
6d37bc9
Compare
warp-agent-staging
Bot
force-pushed
the
factory/multi-team-p2-llm-host
branch
from
August 24, 2026 22:08
6d37bc9 to
08c74ed
Compare
IsaiahWitzke
force-pushed
the
factory/multi-team-p2-llm-host
branch
from
August 26, 2026 03:53
049cb04 to
db599ff
Compare
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
force-pushed
the
factory/multi-team-p2-llm-host
branch
from
August 26, 2026 20:55
ad3f932 to
6c76720
Compare
IsaiahWitzke
approved these changes
Aug 26, 2026
IsaiahWitzke
enabled auto-merge (squash)
August 26, 2026 23:08
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 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 theTeamScope/TeamContextmachinery (#15443), theuser_workspacesmodule 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-canonicalTeamScopepattern.Changes
user_workspaces/mod.rsintouser_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}.TeamScopeas a required argument instead of readingcurrent_workspace()ambiently. The no-team arm follows the exact three-case shape already on master'steam_byo_for_scope(no teams → workspace settings, exactly one team → that team's settings, more than one → deny), sincellm_settingslives on bothWorkspaceSettingsandTeamSettings.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 reportsConflictingrather than picking one team's Google Cloud project arbitrarily.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 ownWeakViewHandleto resolve a scope inshould_render/render).Verification
./script/format --checkandcargo 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 unmodifiedmaster(they fail on sandboxnscisolation restrictions and pre-existing multibyte/zsh handling, both unrelated to team scoping).user_workspaces_tests.rsandgeap_credentials_tests.rsfor 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.