mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
skippable session titles
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user