fix: sanitize streamable HTTP extension names derived from URLs (#7740)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-03-09 10:21:28 +08:00
committed by GitHub
parent 90d34853de
commit 6394165da6
+3 -2
View File
@@ -34,6 +34,7 @@ use completion::GooseCompleter;
use goose::agents::extension::{Envs, ExtensionConfig, PLATFORM_EXTENSIONS};
use goose::agents::types::RetryConfig;
use goose::agents::{Agent, SessionConfig, COMPACT_TRIGGERS};
use goose::config::extensions::name_to_key;
use goose::config::{Config, GooseMode};
use input::InputResult;
use rmcp::model::PromptMessage;
@@ -327,7 +328,7 @@ impl CliSession {
s.push('_');
s.push_str(path);
}
s
name_to_key(&s)
})
.filter(|s| !s.is_empty())
.unwrap_or_else(|| "unnamed".to_string());
@@ -2030,7 +2031,7 @@ mod tests {
#[test_case(
"https://mcp.kiwi.com", 300,
ExtensionConfig::StreamableHttp {
name: "mcp.kiwi.com".into(),
name: "mcp_kiwi_com".into(),
uri: "https://mcp.kiwi.com".into(),
envs: Envs::default(),
env_keys: vec![],