Merge sessions/interactive/9681cb67
This commit is contained in:
@@ -38,6 +38,7 @@ pub async fn handle_command<W: UiWriter>(
|
||||
output.print(" /fragments - List dehydrated context fragments (ACD)");
|
||||
output.print(" /rehydrate - Restore a dehydrated fragment by ID");
|
||||
output.print(" /resume - List and switch to a previous session");
|
||||
output.print(" /research - List pending/completed research tasks");
|
||||
output.print(" /project <path> - Load a project from the given absolute path");
|
||||
output.print(" /unproject - Unload the current project and reset context");
|
||||
output.print(" /dump - Dump entire context window to file for debugging");
|
||||
@@ -130,6 +131,42 @@ pub async fn handle_command<W: UiWriter>(
|
||||
}
|
||||
Ok(true)
|
||||
}
|
||||
"/research" => {
|
||||
let manager = agent.get_pending_research_manager();
|
||||
let all_tasks = manager.list_all();
|
||||
|
||||
if all_tasks.is_empty() {
|
||||
output.print("📋 No research tasks (pending or completed).");
|
||||
} else {
|
||||
output.print(&format!("📋 Research Tasks ({} total):\n", all_tasks.len()));
|
||||
|
||||
for task in all_tasks {
|
||||
let status_emoji = match task.status {
|
||||
g3_core::pending_research::ResearchStatus::Pending => "🔄",
|
||||
g3_core::pending_research::ResearchStatus::Complete => "✅",
|
||||
g3_core::pending_research::ResearchStatus::Failed => "❌",
|
||||
};
|
||||
|
||||
let injected_marker = if task.injected { " (injected)" } else { "" };
|
||||
|
||||
output.print(&format!(
|
||||
" {} `{}` - {} ({}){}\n Query: {}",
|
||||
status_emoji,
|
||||
task.id,
|
||||
task.status,
|
||||
task.elapsed_display(),
|
||||
injected_marker,
|
||||
if task.query.len() > 60 {
|
||||
format!("{}...", &task.query.chars().take(57).collect::<String>())
|
||||
} else {
|
||||
task.query.clone()
|
||||
}
|
||||
));
|
||||
output.print("");
|
||||
}
|
||||
}
|
||||
Ok(true)
|
||||
}
|
||||
cmd if cmd.starts_with("/run") => {
|
||||
let parts: Vec<&str> = cmd.splitn(2, ' ').collect();
|
||||
if parts.len() < 2 || parts[1].trim().is_empty() {
|
||||
|
||||
@@ -211,6 +211,14 @@ pub async fn run_interactive<W: UiWriter>(
|
||||
// Display context window progress bar before each prompt
|
||||
display_context_progress(&agent, &output);
|
||||
|
||||
// Check for completed research and inject into context
|
||||
// This happens before prompting the user for input
|
||||
let injected_count = agent.inject_completed_research();
|
||||
if injected_count > 0 {
|
||||
println!("📋 {} research result(s) ready - injected into context", injected_count);
|
||||
println!();
|
||||
}
|
||||
|
||||
// Build prompt
|
||||
let prompt = build_prompt(in_multiline, agent_name, &active_project);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user