Reduce session logging and background churn
This commit is contained in:
+17
-1
@@ -1000,7 +1000,7 @@ pub enum OpenAIProviderKind {
|
||||
///
|
||||
/// Multiple providers can be configured simultaneously. Each provider has its own endpoint,
|
||||
/// credentials, and model list.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)]
|
||||
#[derive(Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)]
|
||||
#[schemars(description = "Configuration for a direct model provider endpoint.")]
|
||||
pub struct OpenAIProviderConfig {
|
||||
#[serde(default)]
|
||||
@@ -1027,6 +1027,22 @@ pub struct OpenAIProviderConfig {
|
||||
pub models: Vec<OpenAIModelConfig>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for OpenAIProviderConfig {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
formatter
|
||||
.debug_struct("OpenAIProviderConfig")
|
||||
.field("kind", &self.kind)
|
||||
.field("enabled", &self.enabled)
|
||||
.field("name", &self.name)
|
||||
.field("base_url", &self.base_url)
|
||||
.field("api_key_configured", &self.api_key.is_some())
|
||||
.field("project_id", &self.project_id)
|
||||
.field("location", &self.location)
|
||||
.field("models", &self.models)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl settings_value::SettingsValue for OpenAIProviderConfig {}
|
||||
|
||||
fn default_acp_agent_id() -> String {
|
||||
|
||||
@@ -391,6 +391,9 @@ fn native_provider_settings_roundtrip_with_vertex_configuration() {
|
||||
}))
|
||||
.expect("Native OpenAI provider settings should deserialize");
|
||||
assert_eq!(native_openai.kind, OpenAIProviderKind::OpenAI);
|
||||
let debug_output = format!("{native_openai:?}");
|
||||
assert!(!debug_output.contains("sk-test"));
|
||||
assert!(debug_output.contains("api_key_configured: true"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user