feat: goose cli to track directories, allow to resume projects in location (#2503)

This commit is contained in:
Michael Neale
2025-05-13 09:05:10 +10:00
committed by GitHub
parent 0fc1672076
commit 3a4f205945
6 changed files with 509 additions and 0 deletions
+30
View File
@@ -290,6 +290,22 @@ impl Session {
// Persist messages with provider for automatic description generation
session::persist_messages(&self.session_file, &self.messages, Some(provider)).await?;
// Track the current directory and last instruction in projects.json
let session_id = self
.session_file
.file_stem()
.and_then(|s| s.to_str())
.map(|s| s.to_string());
if let Err(e) =
crate::project_tracker::update_project_tracker(Some(&message), session_id.as_deref())
{
eprintln!(
"Warning: Failed to update project tracker with instruction: {}",
e
);
}
self.process_agent_response(false).await?;
Ok(())
}
@@ -356,6 +372,20 @@ impl Session {
self.messages.push(Message::user().with_text(&content));
// Track the current directory and last instruction in projects.json
let session_id = self
.session_file
.file_stem()
.and_then(|s| s.to_str())
.map(|s| s.to_string());
if let Err(e) = crate::project_tracker::update_project_tracker(
Some(&content),
session_id.as_deref(),
) {
eprintln!("Warning: Failed to update project tracker with instruction: {}", e);
}
// Get the provider from the agent for description generation
let provider = self.agent.provider().await?;