skippable session titles

This commit is contained in:
Bradley Axen
2026-01-15 20:29:14 -08:00
parent 2c0121042a
commit aacd3d8aeb
2 changed files with 14 additions and 1 deletions
+4
View File
@@ -929,6 +929,10 @@ config_value!(GOOSE_PROVIDER, String);
config_value!(GOOSE_MODEL, String);
config_value!(GOOSE_MAX_ACTIVE_AGENTS, usize);
/// Config key to enable/disable automatic session name generation.
/// Set to "false" to disable. Defaults to true if not set.
pub const GOOSE_SESSION_NAME_GENERATION: &str = "GOOSE_SESSION_NAME_GENERATION";
/// Load init-config.yaml from workspace root if it exists.
/// This function is shared between the config recovery and the init_config endpoint.
pub fn load_init_config_from_workspace() -> Result<Mapping, ConfigError> {
+10 -1
View File
@@ -1,4 +1,6 @@
use crate::config::base::GOOSE_SESSION_NAME_GENERATION;
use crate::config::paths::Paths;
use crate::config::Config;
use crate::conversation::message::Message;
use crate::conversation::Conversation;
use crate::model::ModelConfig;
@@ -329,7 +331,14 @@ impl SessionManager {
pub async fn maybe_update_name(&self, id: &str, provider: Arc<dyn Provider>) -> Result<()> {
let session = self.get_session(id, true).await?;
if session.user_set_name {
// Skip if disabled via config, user set name, or subagent session
let name_generation_enabled = Config::global()
.get_param::<bool>(GOOSE_SESSION_NAME_GENERATION)
.unwrap_or(true);
if !name_generation_enabled
|| session.user_set_name
|| session.session_type == SessionType::SubAgent
{
return Ok(());
}