Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

feat: land sqlite (#12141)

jif-oaieace7c661026
diff --git a/codex-rs/cli/tests/features.rs b/codex-rs/cli/tests/features.rs
index 8fa07e0a49..6b2ed72f8a 100644
--- a/codex-rs/cli/tests/features.rs
+++ b/codex-rs/cli/tests/features.rs
@@ -49,10 +49,12 @@ async fn features_enable_under_development_feature_prints_warning() -> Result<()
let codex_home = TempDir::new()?;
let mut cmd = codex_command(codex_home.path())?;
- cmd.args(["features", "enable", "sqlite"])
+ cmd.args(["features", "enable", "runtime_metrics"])
.assert()
.success()
- .stderr(contains("Under-development features enabled: sqlite."));
+ .stderr(contains(
+ "Under-development features enabled: runtime_metrics.",
+ ));
Ok(())
}
diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs
index ce594bdd38..4b3f0b9dec 100644
--- a/codex-rs/core/src/features.rs
+++ b/codex-rs/core/src/features.rs
@@ -494,8 +494,8 @@ pub const FEATURES: &[FeatureSpec] = &[
FeatureSpec {
id: Feature::Sqlite,
key: "sqlite",
- stage: Stage::UnderDevelopment,
- default_enabled: false,
+ stage: Stage::Stable,
+ default_enabled: true,
},
FeatureSpec {
id: Feature::MemoryTool,
diff --git a/codex-rs/exec/tests/suite/resume.rs b/codex-rs/exec/tests/suite/resume.rs
index 4169c60dd1..89e125bf8d 100644
--- a/codex-rs/exec/tests/suite/resume.rs
+++ b/codex-rs/exec/tests/suite/resume.rs
@@ -4,11 +4,7 @@ use codex_utils_cargo_bin::find_resource;
use core_test_support::test_codex_exec::test_codex_exec;
use pretty_assertions::assert_eq;
use serde_json::Value;
-use std::fs::FileTimes;
-use std::fs::OpenOptions;
use std::string::ToString;
-use std::time::Duration;
-use std::time::SystemTime;
use tempfile::TempDir;
use uuid::Uuid;
use walkdir::WalkDir;
@@ -257,21 +253,26 @@ fn exec_resume_last_respects_cwd_filter_and_all_flag() -> anyhow::Result<()> {
.success();
let sessions_dir = test.home_path().join("sessions");
- let path_a = find_session_file_containing_marker(&sessions_dir, &marker_a)
+ find_session_file_containing_marker(&sessions_dir, &marker_a)
.expect("no session file found for marker_a");
let path_b = find_session_file_containing_marker(&sessions_dir, &marker_b)
.expect("no session file found for marker_b");
- // Files are ordered by `updated_at`, then by `uuid`.
- // We mutate the mtimes to ensure file_b is the newest file.
- let file_a = OpenOptions::new().write(true).open(&path_a)?;
- file_a.set_times(
- FileTimes::new().set_modified(SystemTime::UNIX_EPOCH + Duration::from_secs(1)),
- )?;
- let file_b = OpenOptions::new().write(true).open(&path_b)?;
- file_b.set_times(
- FileTimes::new().set_modified(SystemTime::UNIX_EPOCH + Duration::from_secs(2)),
- )?;
+ // Make thread B deterministically newest according to rollout metadata.
+ let session_id_b = extract_conversation_id(&path_b);
+ let marker_b_touch = format!("resume-cwd-b-touch-{}", Uuid::new_v4());
+ let prompt_b_touch = format!("echo {marker_b_touch}");
+ test.cmd()
+ .env("CODEX_RS_SSE_FIXTURE", &fixture)
+ .env("OPENAI_BASE_URL", "http://unused.local")
+ .arg("--skip-git-repo-check")
+ .arg("-C")
+ .arg(dir_b.path())
+ .arg("resume")
+ .arg(&session_id_b)
+ .arg(&prompt_b_touch)
+ .assert()
+ .success();
let marker_b2 = format!("resume-cwd-b-2-{}", Uuid::new_v4());
let prompt_b2 = format!("echo {marker_b2}");
@@ -312,8 +313,8 @@ fn exec_resume_last_respects_cwd_filter_and_all_flag() -> anyhow::Result<()> {
let resumed_path_cwd = find_session_file_containing_marker(&sessions_dir, &marker_a2)
.expect("no resumed session file containing marker_a2");
assert_eq!(
- resumed_path_cwd, path_a,
- "resume --last should prefer sessions from the same cwd"
+ resumed_path_cwd, path_b,
+ "resume --last should prefer sessions whose latest turn context matches the current cwd"
);
Ok(())