Skip to content

Commit c140a7e

Browse files
committed
Apply formatting changes
1 parent 012534f commit c140a7e

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

crates/chat-cli/src/cli/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ use std::io::{
1616
use std::process::ExitCode;
1717

1818
use agent::AgentArgs;
19+
pub use agent::{
20+
Agent,
21+
DEFAULT_AGENT_NAME,
22+
};
1923
use anstream::println;
20-
pub use agent::{Agent, DEFAULT_AGENT_NAME};
2124
pub use chat::ConversationState;
2225
use clap::{
2326
ArgAction,

crates/chat-cli/src/util/directories.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,17 @@ pub fn agent_knowledge_dir(os: &Os, agent: Option<&crate::cli::Agent>) -> Result
205205
/// Generate a unique identifier for an agent based on its path and name
206206
fn generate_agent_unique_id(agent: &crate::cli::Agent) -> String {
207207
use std::collections::hash_map::DefaultHasher;
208-
use std::hash::{Hash, Hasher};
209-
208+
use std::hash::{
209+
Hash,
210+
Hasher,
211+
};
212+
210213
if let Some(path) = &agent.path {
211214
// Create a hash from the agent's path for uniqueness
212215
let mut hasher = DefaultHasher::new();
213216
path.hash(&mut hasher);
214217
let path_hash = hasher.finish();
215-
218+
216219
// Combine hash with agent name for readability
217220
format!("{}_{:x}", agent.name, path_hash)
218221
} else {

crates/chat-cli/src/util/knowledge_store.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl KnowledgeStore {
146146
/// Migrate legacy knowledge base from old location if needed
147147
async fn migrate_legacy_knowledge_base(agent_dir: &PathBuf) -> bool {
148148
let mut migrated = false;
149-
149+
150150
// Extract agent identifier from the directory path (last component)
151151
let current_agent_id = agent_dir
152152
.file_name()
@@ -181,9 +181,7 @@ impl KnowledgeStore {
181181
.filter(|entry| {
182182
let name = entry.file_name();
183183
let name_str = name.to_string_lossy();
184-
name_str != current_agent_id
185-
&& name_str != DEFAULT_AGENT_NAME
186-
&& !name_str.starts_with('.')
184+
name_str != current_agent_id && name_str != DEFAULT_AGENT_NAME && !name_str.starts_with('.')
187185
})
188186
.collect();
189187

0 commit comments

Comments
 (0)