Remove Grok OAuth and legacy BYOK support
This commit is contained in:
@@ -57,11 +57,6 @@ pub async fn generate_multi_agent_output(
|
||||
redaction::redact_inputs(&mut params.input);
|
||||
}
|
||||
|
||||
let api_keys = api_keys_with_warp_credit_fallback_setting(
|
||||
params.api_keys,
|
||||
params.allow_use_of_warp_credits,
|
||||
);
|
||||
|
||||
let mut request = api::Request {
|
||||
task_context: Some(api::request::TaskContext {
|
||||
tasks: params.tasks,
|
||||
@@ -91,7 +86,7 @@ pub async fn generate_multi_agent_output(
|
||||
supports_suggest_prompt: true,
|
||||
supports_read_image_files: FeatureFlag::ReadImageFiles.is_enabled(),
|
||||
supports_reasoning_message: true,
|
||||
api_keys,
|
||||
api_keys: params.api_keys,
|
||||
autonomy_level: params.autonomy_level.into(),
|
||||
isolation_level: params.isolation_level.into(),
|
||||
web_search_enabled: params.web_search_enabled,
|
||||
@@ -214,23 +209,6 @@ pub async fn generate_multi_agent_output(
|
||||
}
|
||||
}
|
||||
|
||||
fn api_keys_with_warp_credit_fallback_setting(
|
||||
api_keys: Option<api::request::settings::ApiKeys>,
|
||||
allow_use_of_warp_credits: bool,
|
||||
) -> Option<api::request::settings::ApiKeys> {
|
||||
match api_keys {
|
||||
Some(mut api_keys) => {
|
||||
api_keys.allow_use_of_warp_credits = allow_use_of_warp_credits;
|
||||
Some(api_keys)
|
||||
}
|
||||
None if allow_use_of_warp_credits => Some(api::request::settings::ApiKeys {
|
||||
allow_use_of_warp_credits: true,
|
||||
..Default::default()
|
||||
}),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn supports_orchestration_v2(orchestration_enabled: bool) -> bool {
|
||||
orchestration_enabled
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::HostId;
|
||||
use warp_multi_agent_api as api;
|
||||
|
||||
use super::{
|
||||
api_keys_with_warp_credit_fallback_setting, get_supported_cli_agent_tools, get_supported_tools,
|
||||
supports_orchestration_v2,
|
||||
};
|
||||
use super::{get_supported_cli_agent_tools, get_supported_tools, supports_orchestration_v2};
|
||||
use crate::ai::agent::api::RequestParams;
|
||||
use crate::ai::blocklist::SessionContext;
|
||||
use crate::ai::llms::LLMId;
|
||||
@@ -36,7 +33,6 @@ fn request_params_with_ask_user_question_enabled(ask_user_question_enabled: bool
|
||||
api_keys: None,
|
||||
custom_model_providers: None,
|
||||
custom_model_routers: None,
|
||||
allow_use_of_warp_credits: false,
|
||||
autonomy_level: api::AutonomyLevel::Supervised,
|
||||
isolation_level: api::IsolationLevel::None,
|
||||
web_search_enabled: false,
|
||||
@@ -64,47 +60,6 @@ fn request_params_for_remote(host_id: Option<HostId>) -> RequestParams {
|
||||
params
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn api_keys_with_warp_credit_fallback_setting_returns_none_without_keys_or_fallback() {
|
||||
let api_keys = api_keys_with_warp_credit_fallback_setting(None, false);
|
||||
|
||||
assert!(api_keys.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn api_keys_with_warp_credit_fallback_setting_creates_fallback_only_api_keys() {
|
||||
let api_keys = api_keys_with_warp_credit_fallback_setting(None, true)
|
||||
.expect("fallback setting should create ApiKeys");
|
||||
|
||||
assert!(api_keys.allow_use_of_warp_credits);
|
||||
assert!(api_keys.anthropic.is_empty());
|
||||
assert!(api_keys.openai.is_empty());
|
||||
assert!(api_keys.google.is_empty());
|
||||
assert!(api_keys.open_router.is_empty());
|
||||
assert!(api_keys.aws_credentials.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn api_keys_with_warp_credit_fallback_setting_preserves_existing_keys() {
|
||||
let api_keys = api_keys_with_warp_credit_fallback_setting(
|
||||
Some(api::request::settings::ApiKeys {
|
||||
anthropic: "anthropic-key".to_string(),
|
||||
openai: String::new(),
|
||||
google: String::new(),
|
||||
open_router: String::new(),
|
||||
grok_oauth_access_token: String::new(),
|
||||
allow_use_of_warp_credits: false,
|
||||
aws_credentials: None,
|
||||
google_cloud_credentials: None,
|
||||
}),
|
||||
true,
|
||||
)
|
||||
.expect("existing ApiKeys should be preserved");
|
||||
|
||||
assert_eq!(api_keys.anthropic, "anthropic-key");
|
||||
assert!(api_keys.allow_use_of_warp_credits);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn supports_orchestration_v2_matches_request_orchestration_setting() {
|
||||
assert!(supports_orchestration_v2(true));
|
||||
|
||||
Reference in New Issue
Block a user