Fix memory mode test sqlite home

This commit is contained in:
Tom Wiltzius
2026-04-21 15:16:49 -07:00
parent 792c0f8638
commit 36297c997c
2 changed files with 14 additions and 1 deletions
@@ -231,11 +231,18 @@ mod tests {
#[tokio::test]
async fn update_thread_metadata_sets_memory_mode_on_active_rollout() {
let home = TempDir::new().expect("temp dir");
let store = LocalThreadStore::new(test_config(home.path()));
let config = test_config(home.path());
let store = LocalThreadStore::new(config.clone());
let uuid = Uuid::from_u128(302);
let thread_id = ThreadId::from_string(&uuid.to_string()).expect("valid thread id");
let path =
write_session_file(home.path(), "2025-01-03T14-30-00", uuid).expect("session file");
let runtime = codex_state::StateRuntime::init(
home.path().to_path_buf(),
config.model_provider_id.clone(),
)
.await
.expect("state db should initialize");
let thread = store
.update_thread_metadata(UpdateThreadMetadataParams {
@@ -254,6 +261,11 @@ mod tests {
assert_eq!(appended["type"], "session_meta");
assert_eq!(appended["payload"]["id"], thread_id.to_string());
assert_eq!(appended["payload"]["memory_mode"], "disabled");
let memory_mode = runtime
.get_thread_memory_mode(thread_id)
.await
.expect("thread memory mode should be readable");
assert_eq!(memory_mode.as_deref(), Some("disabled"));
}
#[tokio::test]
+1
View File
@@ -1537,6 +1537,7 @@ async fn update_memory_settings_updates_current_thread_memory_mode() -> Result<(
let (mut app, _app_event_rx, _op_rx) = make_test_app_with_channels().await;
let codex_home = tempdir()?;
app.config.codex_home = codex_home.path().to_path_buf().abs();
app.config.sqlite_home = codex_home.path().to_path_buf();
// Seed the previous setting so this test exercises the thread-mode update path.
app.config.memories.generate_memories = true;