fix(goose): only send agent-session-id when a session exists (#6657)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-01-27 13:43:05 +09:00
committed by GitHub
parent 3dae12765f
commit f5b402bbdf
37 changed files with 398 additions and 383 deletions
+3 -1
View File
@@ -378,12 +378,14 @@ mod tests {
async fn complete_with_model(
&self,
session_id: &str,
session_id: Option<&str>,
_model_config: &ModelConfig,
system_prompt: &str,
messages: &[Message],
tools: &[Tool],
) -> anyhow::Result<(Message, ProviderUsage), ProviderError> {
// Test-only: coerce missing session_id to empty so complete() can be reused.
let session_id = session_id.unwrap_or("");
self.complete(session_id, system_prompt, messages, tools)
.await
}
+3 -26
View File
@@ -94,9 +94,10 @@ impl MockCompactionProvider {
#[async_trait]
impl Provider for MockCompactionProvider {
async fn complete(
async fn complete_with_model(
&self,
_session_id: &str,
_session_id: Option<&str>,
_model_config: &ModelConfig,
system_prompt: &str,
messages: &[Message],
_tools: &[Tool],
@@ -165,30 +166,6 @@ impl Provider for MockCompactionProvider {
Ok((message, usage))
}
async fn complete_with_model(
&self,
session_id: &str,
_model_config: &ModelConfig,
system_prompt: &str,
messages: &[Message],
tools: &[Tool],
) -> Result<(Message, ProviderUsage), ProviderError> {
self.complete(session_id, system_prompt, messages, tools)
.await
}
async fn complete_fast(
&self,
session_id: &str,
system_prompt: &str,
messages: &[Message],
tools: &[Tool],
) -> Result<(Message, ProviderUsage), ProviderError> {
// Compaction uses complete_fast, so delegate to complete
self.complete(session_id, system_prompt, messages, tools)
.await
}
fn get_model_config(&self) -> ModelConfig {
ModelConfig::new("mock-model").unwrap()
}
+1 -1
View File
@@ -59,7 +59,7 @@ impl Provider for MockProvider {
async fn complete_with_model(
&self,
_session_id: &str,
_session_id: Option<&str>,
_model_config: &ModelConfig,
_system: &str,
_messages: &[Message],