refactor: move disable_session_naming into AgentConfig (#7062)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-02-07 08:55:55 +08:00
committed by GitHub
parent 96f903d5d3
commit 948cb91d54
12 changed files with 329 additions and 1042 deletions
+2 -11
View File
@@ -119,8 +119,7 @@ impl ExpectedSessionId {
}
}
/// Calling this ensures incidental requests that might error asynchronously, such as
/// session rename have coherent session IDs.
/// Calling this ensures requests have coherent session IDs.
pub fn assert_matches(&self, actual: &str) {
let result = self.validate(Some(actual));
assert!(result.is_ok(), "{}", result.unwrap_err());
@@ -165,15 +164,6 @@ impl OpenAiFixture {
.set_body_json(serde_json::json!({"error": {"message": e}}));
}
// Session rename (async, unpredictable order) - canned response
if body.contains("Reply with only a description in four words or less") {
return ResponseTemplate::new(200)
.insert_header("content-type", "application/json")
.set_body_string(include_str!(
"../test_data/openai_session_description.json"
));
}
// See if the actual request matches the expected pattern
let mut q = queue.lock().unwrap();
let (expected_body, response) = q.front().cloned().unwrap_or_default();
@@ -396,6 +386,7 @@ pub async fn spawn_acp_server_in_process(
data_dir: data_root.to_path_buf(),
config_dir: data_root.to_path_buf(),
goose_mode,
disable_session_naming: true,
};
let (client_read, server_write) = tokio::io::duplex(64 * 1024);
@@ -1 +0,0 @@
{"id":"chatcmpl-test","object":"chat.completion","created":1766229622,"model":"gpt-5-nano","choices":[{"index":0,"message":{"role":"assistant","content":"Test session"},"finish_reason":"stop"}],"usage":{"prompt_tokens":79,"completion_tokens":10,"total_tokens":89}}