Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7c5db7d
Standardize on session name instead of description
wpfleger96 Oct 8, 2025
d0be934
Make everything backwards compatible
wpfleger96 Oct 8, 2025
0d7c19b
Add migration tests
wpfleger96 Oct 15, 2025
c37fc07
Add DB migration helper script
wpfleger96 Oct 15, 2025
d0b0c85
Merge branch 'main' into wpfleger/standardize-session-attributes
wpfleger96 Oct 15, 2025
28f91db
Merge branch 'main' into wpfleger/standardize-session-attributes
wpfleger96 Oct 15, 2025
0de3460
Bug fixes when merging another DB migration from main branch
wpfleger96 Oct 15, 2025
b53f983
botched merge conflict resolution
wpfleger96 Oct 15, 2025
2b8bc8f
linter findings
wpfleger96 Oct 16, 2025
5b91c6f
Merge branch 'main' into wpfleger/standardize-session-attributes
wpfleger96 Oct 16, 2025
ae04e4e
missed this one when merging latest changes from main
wpfleger96 Oct 16, 2025
3e6cd28
Merge branch 'main' into wpfleger/standardize-session-attributes
wpfleger96 Oct 16, 2025
4b7aa71
comment cleanup
wpfleger96 Oct 16, 2025
967d6c6
We should still accept matching session ID -> name for backwards comp…
wpfleger96 Oct 16, 2025
484baee
Finish standardizing session naming: API, UI, and CLI search consistency
wpfleger96 Oct 16, 2025
7bdafc8
Get rid of unnecessary public user_set_name function
wpfleger96 Oct 16, 2025
f5fa139
clarify serde alias
wpfleger96 Oct 16, 2025
44c9a15
Name should be required when starting a session
wpfleger96 Oct 17, 2025
43d9416
Unrelated redundant condition check that Claude Code found
wpfleger96 Oct 17, 2025
ddc6b6b
Merge branch 'main' into wpfleger/standardize-session-attributes
wpfleger96 Oct 17, 2025
2389e98
silly LLM change
wpfleger96 Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/goose-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async fn get_session_id(identifier: Identifier) -> Result<String> {

sessions
.into_iter()
.find(|s| s.id == name || s.description.contains(&name))
.find(|s| s.name == name)
.map(|s| s.id)
.ok_or_else(|| anyhow::anyhow!("No session found with name '{}'", name))
} else if let Some(path) = identifier.path {
Expand Down
2 changes: 1 addition & 1 deletion crates/goose-cli/src/commands/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub async fn handle_schedule_sessions(id: String, limit: Option<usize>) -> Resul
" - Session ID: {}, Working Dir: {}, Description: \"{}\", Schedule ID: {:?}",
session_name, // Display the session_name as Session ID
metadata.working_dir.display(),
metadata.description,
metadata.name,
metadata.schedule_id.as_deref().unwrap_or("N/A")
);
}
Expand Down
21 changes: 9 additions & 12 deletions crates/goose-cli/src/commands/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TRUNCATED_DESC_LENGTH: usize = 60;
pub async fn remove_sessions(sessions: Vec<Session>) -> Result<()> {
println!("The following sessions will be removed:");
for session in &sessions {
println!("- {} {}", session.id, session.description);
println!("- {} {}", session.id, session.name);
}

let should_delete = confirm("Are you sure you want to delete these sessions?")
Expand Down Expand Up @@ -45,10 +45,10 @@ fn prompt_interactive_session_removal(sessions: &[Session]) -> Result<Vec<Sessio
let display_map: std::collections::HashMap<String, Session> = sessions
.iter()
.map(|s| {
let desc = if s.description.is_empty() {
"(no description)"
let desc = if s.name.is_empty() {
"(no name)"
} else {
&s.description
&s.name
};
let truncated_desc = safe_truncate(desc, TRUNCATED_DESC_LENGTH);
let display_text = format!("{} - {} ({})", s.updated_at, truncated_desc, s.id);
Expand Down Expand Up @@ -154,10 +154,7 @@ pub async fn handle_session_list(

println!("Available sessions:");
for session in sessions {
let output = format!(
"{} - {} - {}",
session.id, session.description, session.updated_at
);
let output = format!("{} - {} - {}", session.id, session.name, session.updated_at);
println!("{}", output);
}
}
Expand Down Expand Up @@ -188,7 +185,7 @@ pub async fn handle_session_export(
let conversation = session
.conversation
.ok_or_else(|| anyhow::anyhow!("Session has no messages"))?;
export_session_to_markdown(conversation.messages().to_vec(), &session.description)
export_session_to_markdown(conversation.messages().to_vec(), &session.name)
}
_ => return Err(anyhow::anyhow!("Unsupported format: {}", format)),
};
Expand Down Expand Up @@ -293,10 +290,10 @@ pub async fn prompt_interactive_session_selection() -> Result<String> {
let display_map: std::collections::HashMap<String, Session> = sessions
.iter()
.map(|s| {
let desc = if s.description.is_empty() {
"(no description)"
let desc = if s.name.is_empty() {
"(no name)"
} else {
&s.description
&s.name
};
let truncated_desc = safe_truncate(desc, TRUNCATED_DESC_LENGTH);

Expand Down
4 changes: 2 additions & 2 deletions crates/goose-cli/src/commands/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub async fn handle_web(
async fn serve_index() -> Result<Redirect, (http::StatusCode, String)> {
let session = SessionManager::create_session(
std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from(".")),
"Web session".to_string(),
Some("Web session".to_string()),
)
.await
.map_err(|err| (http::StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
Expand Down Expand Up @@ -290,7 +290,7 @@ async fn list_sessions() -> Json<serde_json::Value> {
session_info.push(serde_json::json!({
"name": session.id,
"path": session.id,
"description": session.description,
"description": session.name,
"message_count": session.message_count,
"working_dir": session.working_dir
}));
Expand Down
9 changes: 3 additions & 6 deletions crates/goose-cli/src/session/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,9 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> CliSession {
} else if let Some(session_id) = session_config.session_id {
Some(session_id)
} else {
let session = SessionManager::create_session(
std::env::current_dir().unwrap(),
"CLI Session".to_string(),
)
.await
.unwrap();
let session = SessionManager::create_session(std::env::current_dir().unwrap(), None)
.await
.unwrap();
Some(session.id)
};

Expand Down
4 changes: 2 additions & 2 deletions crates/goose-server/src/routes/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ async fn start_agent(
}

let counter = state.session_counter.fetch_add(1, Ordering::SeqCst) + 1;
let description = format!("New session {}", counter);
let name = format!("New session {}", counter);

let mut session = SessionManager::create_session(PathBuf::from(&working_dir), description)
let mut session = SessionManager::create_session(PathBuf::from(&working_dir), Some(name))
.await
.map_err(|err| {
error!("Failed to create session: {}", err);
Expand Down
4 changes: 2 additions & 2 deletions crates/goose-server/src/routes/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn default_limit() -> u32 {
#[serde(rename_all = "camelCase")]
pub struct SessionDisplayInfo {
id: String, // Derived from session_name (filename)
name: String, // From metadata.description
name: String, // From metadata.name
created_at: String, // Derived from session_name, in ISO 8601 format
working_dir: String, // from metadata.working_dir (as String)
schedule_id: Option<String>,
Expand Down Expand Up @@ -325,7 +325,7 @@ async fn sessions_handler(
for (session_name, session) in session_tuples {
display_infos.push(SessionDisplayInfo {
id: session_name.clone(),
name: session.description,
name: session.name,
created_at: parse_session_name_to_iso(&session_name),
working_dir: session.working_dir.to_string_lossy().into_owned(),
schedule_id: session.schedule_id,
Expand Down
2 changes: 1 addition & 1 deletion crates/goose-server/src/routes/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn update_session_description(
}

SessionManager::update_session(&session_id)
.description(request.description)
.name(request.description)
.apply()
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Expand Down
4 changes: 1 addition & 3 deletions crates/goose/src/agents/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,7 @@ impl Agent {
let provider = self.provider().await?;
let session_id = session_config.id.clone();
tokio::spawn(async move {
if let Err(e) =
SessionManager::maybe_update_description(&session_id, provider).await
{
if let Err(e) = SessionManager::maybe_update_name(&session_id, provider).await {
warn!("Failed to generate session description: {}", e);
}
});
Expand Down
2 changes: 1 addition & 1 deletion crates/goose/src/agents/subagent_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn get_agent_messages(
let working_dir = task_config.parent_working_dir;
let session = SessionManager::create_session(
working_dir.clone(),
format!("Subagent task for: {}", parent_session_id),
Some(format!("Subagent task for: {}", parent_session_id)),
)
.await
.map_err(|e| anyhow!("Failed to create a session for sub agent: {}", e))?;
Expand Down
4 changes: 2 additions & 2 deletions crates/goose/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,11 +1174,11 @@ async fn run_scheduled_job_internal(
// Create session upfront for both cases
let session = match SessionManager::create_session(
current_dir.clone(),
if recipe.prompt.is_some() {
Some(if recipe.prompt.is_some() {
format!("Scheduled job: {}", job.id)
} else {
"Empty job - no prompt".to_string()
},
}),
)
.await
{
Expand Down
Loading
Loading