mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-26 15:40:18 +00:00
chore: fmt
This commit is contained in:
+7
-6
@@ -726,9 +726,7 @@ async fn get_secrets_store() -> anyhow::Result<Arc<dyn SecretsStore + Send + Syn
|
||||
crate::cli::init_secrets_store().await
|
||||
}
|
||||
|
||||
fn as_settings_store(
|
||||
db: Option<&dyn Database>,
|
||||
) -> Option<&(dyn crate::db::SettingsStore + Sync)> {
|
||||
fn as_settings_store(db: Option<&dyn Database>) -> Option<&(dyn crate::db::SettingsStore + Sync)> {
|
||||
db.map(|db| db as &(dyn crate::db::SettingsStore + Sync))
|
||||
}
|
||||
|
||||
@@ -905,7 +903,10 @@ mod tests {
|
||||
Err(DatabaseError::Query("unused in test".to_string()))
|
||||
}
|
||||
|
||||
async fn list_settings(&self, _user_id: &str) -> Result<Vec<SettingRow>, DatabaseError> {
|
||||
async fn list_settings(
|
||||
&self,
|
||||
_user_id: &str,
|
||||
) -> Result<Vec<SettingRow>, DatabaseError> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
@@ -979,8 +980,8 @@ mod tests {
|
||||
assert_eq!(llm.backend, "nearai");
|
||||
assert_eq!(llm.nearai.model, "db-backed-nearai-model");
|
||||
|
||||
let companion = config::derive_nearai_companion_mcp_server_from_llm(&llm)
|
||||
.expect("derived companion");
|
||||
let companion =
|
||||
config::derive_nearai_companion_mcp_server_from_llm(&llm).expect("derived companion");
|
||||
assert_eq!(companion.url, "http://127.0.0.1:11434/mcp");
|
||||
}
|
||||
}
|
||||
|
||||
+18
-19
@@ -6230,15 +6230,14 @@ mod tests {
|
||||
);
|
||||
let channels_dir = dir.path().join("channels");
|
||||
|
||||
let mgr =
|
||||
make_test_manager_with_dirs(
|
||||
None,
|
||||
tools_dir,
|
||||
channels_dir,
|
||||
Some(Arc::clone(&store)),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mgr = make_test_manager_with_dirs(
|
||||
None,
|
||||
tools_dir,
|
||||
channels_dir,
|
||||
Some(Arc::clone(&store)),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mut fields = std::collections::HashMap::new();
|
||||
fields.insert("llm_backend".to_string(), "openai".to_string());
|
||||
|
||||
@@ -6290,15 +6289,14 @@ mod tests {
|
||||
);
|
||||
let channels_dir = dir.path().join("channels");
|
||||
|
||||
let mgr =
|
||||
make_test_manager_with_dirs(
|
||||
None,
|
||||
tools_dir,
|
||||
channels_dir,
|
||||
Some(Arc::clone(&store)),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mgr = make_test_manager_with_dirs(
|
||||
None,
|
||||
tools_dir,
|
||||
channels_dir,
|
||||
Some(Arc::clone(&store)),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mut fields = std::collections::HashMap::new();
|
||||
fields.insert("session".to_string(), "overwrite".to_string());
|
||||
|
||||
@@ -7639,7 +7637,8 @@ mod tests {
|
||||
let dir = tempfile::tempdir().expect("temp dir");
|
||||
let tools_dir = dir.path().join("tools");
|
||||
let channels_dir = dir.path().join("channels");
|
||||
let mgr = make_test_manager_with_dirs(None, tools_dir, channels_dir.clone(), None, None, None);
|
||||
let mgr =
|
||||
make_test_manager_with_dirs(None, tools_dir, channels_dir.clone(), None, None, None);
|
||||
|
||||
let wasm_path = channels_dir.join("telegram.wasm");
|
||||
let cap_path = channels_dir.join("telegram.capabilities.json");
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ pub mod config;
|
||||
pub mod costs;
|
||||
pub mod error;
|
||||
pub mod failover;
|
||||
pub mod nearai_auth;
|
||||
pub mod gemini_oauth;
|
||||
mod github_copilot;
|
||||
pub(crate) mod github_copilot_auth;
|
||||
pub mod nearai_auth;
|
||||
mod nearai_chat;
|
||||
pub mod oauth_helpers;
|
||||
pub mod openai_codex_provider;
|
||||
@@ -53,8 +53,8 @@ pub use config::{
|
||||
};
|
||||
pub use error::LlmError;
|
||||
pub use failover::{CooldownConfig, FailoverProvider};
|
||||
pub use nearai_auth::{resolve_nearai_bearer_token, resolve_nearai_bearer_token_if_available};
|
||||
pub use gemini_oauth::GeminiOauthProvider;
|
||||
pub use nearai_auth::{resolve_nearai_bearer_token, resolve_nearai_bearer_token_if_available};
|
||||
pub use nearai_chat::{DEFAULT_MODEL, ModelInfo, NearAiChatProvider, default_models};
|
||||
pub use openai_codex_provider::OpenAiCodexProvider;
|
||||
pub use openai_codex_session::{OpenAiCodexSession, OpenAiCodexSessionManager};
|
||||
|
||||
@@ -914,7 +914,7 @@ mod tests {
|
||||
crate::tools::mcp::config::NEARAI_COMPANION_MCP_NAME,
|
||||
"http://localhost:3000/mcp",
|
||||
)
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
let nearai_session = Arc::new(NearAiSessionManager::new(NearAiSessionConfig::default()));
|
||||
nearai_session
|
||||
.set_token(SecretString::from("sess_test_token"))
|
||||
@@ -941,7 +941,7 @@ mod tests {
|
||||
crate::tools::mcp::config::NEARAI_COMPANION_MCP_NAME,
|
||||
"http://localhost:3000/mcp",
|
||||
)
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
let nearai_session = Arc::new(NearAiSessionManager::new(NearAiSessionConfig::default()));
|
||||
|
||||
let client = McpClient::new_with_config(config)
|
||||
@@ -1011,7 +1011,7 @@ mod tests {
|
||||
crate::tools::mcp::config::NEARAI_COMPANION_MCP_NAME,
|
||||
"http://localhost:3000/mcp",
|
||||
)
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
.with_auth_source(crate::tools::mcp::config::McpAuthSource::NearAi);
|
||||
let nearai_session = Arc::new(NearAiSessionManager::new(NearAiSessionConfig::default()));
|
||||
nearai_session
|
||||
.set_token(SecretString::from("sess_runtime_token"))
|
||||
|
||||
Reference in New Issue
Block a user