Improve agent prompting and classifier latency; clean up build warnings
This commit is contained in:
@@ -75,6 +75,7 @@ pub fn convert_conversation_data_to_ai_conversation(
|
||||
agent_backend: Default::default(),
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: Default::default(),
|
||||
server_conversation_token: None,
|
||||
conversation_usage_metadata: usage_metadata,
|
||||
reverted_action_ids: None,
|
||||
@@ -100,6 +101,7 @@ pub fn convert_conversation_data_to_ai_conversation(
|
||||
agent_backend: Default::default(),
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: Default::default(),
|
||||
server_conversation_token: Some(
|
||||
metadata.server_conversation_token.as_str().to_string(),
|
||||
),
|
||||
|
||||
@@ -234,6 +234,7 @@ pub struct AIConversation {
|
||||
/// Opaque, versioned snapshot of the active direct-provider run.
|
||||
active_provider_run_json: Option<String>,
|
||||
local_agent_groups: Vec<LocalAgentGroup>,
|
||||
tool_titles: HashMap<String, String>,
|
||||
|
||||
/// The server-generated unique "token" for this conversation.
|
||||
///
|
||||
@@ -389,6 +390,7 @@ impl AIConversation {
|
||||
agent_backend,
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: HashMap::new(),
|
||||
server_conversation_token: None,
|
||||
task_id: None,
|
||||
forked_from_server_conversation_token: None,
|
||||
@@ -547,6 +549,10 @@ impl AIConversation {
|
||||
(task_store, todo_lists, status)
|
||||
};
|
||||
|
||||
let tool_titles = conversation_data
|
||||
.as_ref()
|
||||
.map(|data| data.tool_titles.clone())
|
||||
.unwrap_or_default();
|
||||
let local_agent_groups = conversation_data
|
||||
.as_ref()
|
||||
.map(|data| data.local_agent_groups.clone())
|
||||
@@ -682,6 +688,7 @@ impl AIConversation {
|
||||
agent_backend,
|
||||
active_provider_run_json,
|
||||
local_agent_groups,
|
||||
tool_titles,
|
||||
server_conversation_token,
|
||||
task_id: run_id.as_deref().and_then(|id| id.parse().ok()),
|
||||
forked_from_server_conversation_token,
|
||||
@@ -725,6 +732,14 @@ impl AIConversation {
|
||||
&self.agent_backend
|
||||
}
|
||||
|
||||
pub(crate) fn tool_titles(&self) -> &HashMap<String, String> {
|
||||
&self.tool_titles
|
||||
}
|
||||
|
||||
pub(crate) fn set_tool_title(&mut self, action_id: &AIAgentActionId, title: String) {
|
||||
self.tool_titles.insert(action_id.to_string(), title);
|
||||
}
|
||||
|
||||
pub(crate) fn local_agent_groups(&self) -> &[LocalAgentGroup] {
|
||||
&self.local_agent_groups
|
||||
}
|
||||
@@ -4050,6 +4065,7 @@ impl AIConversation {
|
||||
agent_backend: self.agent_backend.clone(),
|
||||
active_provider_run_json: self.active_provider_run_json.clone(),
|
||||
local_agent_groups: self.local_agent_groups.clone(),
|
||||
tool_titles: self.tool_titles.clone(),
|
||||
server_conversation_token: self
|
||||
.server_conversation_token
|
||||
.clone()
|
||||
|
||||
@@ -80,7 +80,7 @@ pub fn compute_active_task_ids<'a>(
|
||||
/// missing task are assigned depth 0.
|
||||
pub fn compute_task_depths(tasks: &HashMap<String, api::Task>) -> HashMap<&str, usize> {
|
||||
let mut depths = HashMap::new();
|
||||
for (task_id, _) in tasks.iter() {
|
||||
for task_id in tasks.keys() {
|
||||
let mut depth = 0;
|
||||
let mut current_id: &str = task_id;
|
||||
let mut visited = HashSet::new();
|
||||
|
||||
@@ -1211,10 +1211,7 @@ impl<'a> std::fmt::Display for MarkdownActionResult<'a> {
|
||||
match self.0 {
|
||||
AIAgentActionResultType::RequestCommandOutput(result) => match result {
|
||||
RequestCommandOutputResult::Completed {
|
||||
command,
|
||||
output,
|
||||
exit_code: _,
|
||||
..
|
||||
command, output, ..
|
||||
} => {
|
||||
write!(
|
||||
f,
|
||||
|
||||
Reference in New Issue
Block a user