refactor: 清理未使用的 dead code 函数与方法

This commit is contained in:
oudecheng 2026-08-03 14:21:01 +08:00
parent f8e1f3c2eb
commit 3b0de7d071
3 changed files with 3 additions and 12 deletions

View File

@ -642,17 +642,6 @@ fn chat_message_to_llm_message(m: &ChatMessage, image_budget: &mut ImageInlineBu
}
}
fn chat_message_to_text_only_llm_message(m: &ChatMessage) -> Message {
Message {
role: m.role.clone(),
content: vec![ContentBlock::text(&m.content)],
reasoning_content: m.reasoning_content.clone(),
tool_call_id: m.tool_call_id.clone(),
name: m.tool_name.clone(),
tool_calls: m.tool_calls.clone(),
}
}
/// AgentLoop - Stateless agent that processes messages with tool calling support.
/// History is managed externally by SessionManager.
pub struct AgentLoop {

View File

@ -512,7 +512,8 @@ impl Session {
.unwrap_or(false)
}
pub(crate) fn matches_current_user_turn(&self, topic_id: &str, message: &ChatMessage) -> bool {
#[cfg(test)]
fn matches_current_user_turn(&self, topic_id: &str, message: &ChatMessage) -> bool {
self.history.matches_current_user_turn(topic_id, message)
}

View File

@ -220,6 +220,7 @@ impl SessionHistory {
.and_then(|history| history.iter().rev().find(|message| message.role == "user"))
}
#[cfg(test)]
pub(crate) fn matches_current_user_turn(&self, topic_id: &str, message: &ChatMessage) -> bool {
self.latest_user_message(topic_id)
.map(|current| {