Improve agent prompting and classifier latency; clean up build warnings
This commit is contained in:
@@ -504,7 +504,7 @@ impl SecretRedactionState {
|
||||
// the case where a secret is split across streaming chunks.
|
||||
let combined_text = format!(
|
||||
"{}{}",
|
||||
&self.last_word_to_rescan_for_redaction,
|
||||
self.last_word_to_rescan_for_redaction,
|
||||
&text[self.last_scanned_secret_redaction_byte_index..]
|
||||
);
|
||||
let secret_ranges_with_levels =
|
||||
|
||||
@@ -729,14 +729,8 @@ impl BlocklistAIContextModel {
|
||||
) -> Option<&'a AIAgentTodoList> {
|
||||
self.selected_conversation(ctx)
|
||||
.and_then(|c| c.active_todo_list())
|
||||
.and_then(|todo_list| {
|
||||
// Don't show todo list if it's empty or finished
|
||||
if todo_list.is_empty() || todo_list.is_finished() {
|
||||
None
|
||||
} else {
|
||||
Some(todo_list)
|
||||
}
|
||||
})
|
||||
// Don't show todo list if it's empty or finished
|
||||
.filter(|&todo_list| !(todo_list.is_empty() || todo_list.is_finished()))
|
||||
}
|
||||
|
||||
pub fn pending_query_autoexecute_override(
|
||||
|
||||
@@ -122,7 +122,8 @@ const PROGRESSIVE_SUMMARY_PROMPT: &str = "Create a concise, factual task-state c
|
||||
- Decisions made and the rationale needed to continue\n\
|
||||
- Files changed and the material result of each change\n\
|
||||
- Significant tool outcomes, errors, identifiers, and unresolved blockers\n\
|
||||
- Current progress and the next concrete steps\n\n\
|
||||
- Current progress and the next concrete steps; distinguish completed work from intentions\n\
|
||||
- Delegated scope, concrete findings with file paths or tool-result IDs, and the exact remaining uncertainty\n\n\
|
||||
Omit greetings, agreement, praise, reassurance, filler, routine status narration, repeated content, and stylistic assistant phrasing. Summarize completed tool work by outcome instead of listing every call. Do not quote prior assistant wording unless its exact text is task-critical. Return only the checkpoint, structured for another agent to resume the work.";
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -7634,6 +7635,15 @@ impl BlocklistAIController {
|
||||
else {
|
||||
return;
|
||||
};
|
||||
let tool_titles = batch
|
||||
.calls
|
||||
.iter()
|
||||
.filter_map(|pending| {
|
||||
run.action_context
|
||||
.tool_call_title(&pending.call)
|
||||
.map(|title| (pending.call.id.clone(), title))
|
||||
})
|
||||
.collect::<HashMap<_, _>>();
|
||||
let (mut converted_actions, invalid_results) =
|
||||
convert_provider_tool_batch(&run.action_context, &batch);
|
||||
for result in &invalid_results {
|
||||
@@ -7742,6 +7752,13 @@ impl BlocklistAIController {
|
||||
} else {
|
||||
let apply_result =
|
||||
BlocklistAIHistoryModel::handle(ctx).update(ctx, |history_model, ctx| {
|
||||
if let Some(title) = tool_titles.get(&action.id.to_string()) {
|
||||
if let Some(conversation) =
|
||||
history_model.conversation_mut(&conversation_id)
|
||||
{
|
||||
conversation.set_tool_title(&action.id, title.clone());
|
||||
}
|
||||
}
|
||||
history_model.apply_domain_tool_proposal(
|
||||
&stream_id,
|
||||
conversation_id,
|
||||
|
||||
@@ -1705,6 +1705,7 @@ impl BlocklistAIHistoryModel {
|
||||
agent_backend: source_conversation.agent_backend().for_fork(),
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: source_conversation.tool_titles().clone(),
|
||||
server_conversation_token: None,
|
||||
conversation_usage_metadata: Some(source_conversation.usage_metadata()),
|
||||
reverted_action_ids,
|
||||
@@ -1871,6 +1872,7 @@ impl BlocklistAIHistoryModel {
|
||||
agent_backend: conversation.agent_backend().for_fork(),
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: conversation.tool_titles().clone(),
|
||||
server_conversation_token: None,
|
||||
conversation_usage_metadata: None,
|
||||
reverted_action_ids,
|
||||
@@ -2882,6 +2884,7 @@ fn merged_remote_child_placeholder_conversation_data(
|
||||
// Active process-local provider runs cannot be merged from a cloud transcript.
|
||||
active_provider_run_json: None,
|
||||
local_agent_groups: Vec::new(),
|
||||
tool_titles: Default::default(),
|
||||
|
||||
// Cloud authoritative.
|
||||
server_conversation_token: cloud_conversation
|
||||
|
||||
@@ -2118,15 +2118,15 @@ impl CodeDiffView {
|
||||
}
|
||||
|
||||
fn position_id_for_file(&self, i: usize) -> String {
|
||||
format!("CodeDiffView-{}-tab-{i}", &self.position_id_prefix)
|
||||
format!("CodeDiffView-{}-tab-{i}", self.position_id_prefix)
|
||||
}
|
||||
|
||||
fn position_id_for_inline_editor(&self) -> String {
|
||||
format!("CodeDiffView-inline-editor-{}", &self.position_id_prefix)
|
||||
format!("CodeDiffView-inline-editor-{}", self.position_id_prefix)
|
||||
}
|
||||
|
||||
fn position_id_for_inline_speedbump(&self) -> String {
|
||||
format!("CodeDiffView-inline-speedbump-{}", &self.position_id_prefix)
|
||||
format!("CodeDiffView-inline-speedbump-{}", self.position_id_prefix)
|
||||
}
|
||||
|
||||
fn position_id_for_accept_split_button(&self) -> String {
|
||||
|
||||
@@ -139,7 +139,7 @@ impl SuggestedUnitTestsView {
|
||||
fn position_id_for_speedbump(&self) -> String {
|
||||
format!(
|
||||
"SuggestedUnitTestsView-speedbump-{}",
|
||||
&self.position_id_prefix
|
||||
self.position_id_prefix
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -799,7 +799,7 @@ impl BlocklistAIInputModel {
|
||||
if use_local_model {
|
||||
// A cancelled debounce never starts inference. The local worker
|
||||
// also cancels obsolete requests already queued or generating.
|
||||
warpui::r#async::Timer::after(std::time::Duration::from_millis(300)).await;
|
||||
warpui::r#async::Timer::after(std::time::Duration::from_millis(100)).await;
|
||||
let result = crate::local_inference::classify(
|
||||
buffer_cloned.to_string(),
|
||||
history_entries.as_deref().unwrap_or_default(),
|
||||
|
||||
@@ -365,8 +365,7 @@ impl PassiveSuggestionsModel {
|
||||
#[cfg(feature = "local_fs")]
|
||||
if is_passive_code_diffs_enabled {
|
||||
if let Some(current_working_directory) = block_completed.serialized_block.pwd.clone() {
|
||||
let block_contents =
|
||||
format!("{}\n{}", &block_context.command, &block_context.output);
|
||||
let block_contents = format!("{}\n{}", block_context.command, block_context.output);
|
||||
let shell = self.active_session.as_ref(ctx).shell_launch_data(ctx);
|
||||
let shell_for_detection = shell.clone();
|
||||
let current_working_directory_for_detection = current_working_directory.clone();
|
||||
|
||||
Reference in New Issue
Block a user