mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
[codex] Restore thread recency with compatible migration history (#28671)
## Summary - Revert #28655, restoring the thread `recencyAt` behavior introduced by #27910. - Move `threads_recency_at` to migration 0039 so it no longer collides with `external_agent_config_imports` at version 0038. - Repair databases that already applied the recency migration as version 38 by moving the matching migration-history row to version 39 before SQLx validation. The current version-38 migration can then apply normally. ## Validation - `just test -p codex-state migrations::tests::repairs_recency_migration_that_was_applied_as_version_38` - `just test -p codex-state -p codex-rollout -p codex-thread-store -p codex-app-server-protocol -p codex-tui`: 3,439 passed; six TUI tests could not open the machine's existing read-only incident database at `~/.codex/sqlite/state_5.sqlite`. - `just fix -p codex-state` - `just fmt` - Verified that state migration versions are unique.
This commit is contained in:
1 parent
d9e0551564
commit
7dc7096ae1
67 files changed
+1274
-100
No files matched your search
@@ -612,6 +612,7 @@ async fn test_list_conversations_latest_first() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-01-03T12-00-00".into()),
|
||||
recency_at: updated_times.first().cloned().flatten(),
|
||||
updated_at: updated_times.first().cloned().flatten(),
|
||||
},
|
||||
ThreadItem {
|
||||
@@ -630,6 +631,7 @@ async fn test_list_conversations_latest_first() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-01-02T12-00-00".into()),
|
||||
recency_at: updated_times.get(1).cloned().flatten(),
|
||||
updated_at: updated_times.get(1).cloned().flatten(),
|
||||
},
|
||||
ThreadItem {
|
||||
@@ -648,6 +650,7 @@ async fn test_list_conversations_latest_first() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-01-01T12-00-00".into()),
|
||||
recency_at: updated_times.get(2).cloned().flatten(),
|
||||
updated_at: updated_times.get(2).cloned().flatten(),
|
||||
},
|
||||
],
|
||||
@@ -759,6 +762,7 @@ async fn test_pagination_cursor() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-03-05T09-00-00".into()),
|
||||
recency_at: updated_page1.first().cloned().flatten(),
|
||||
updated_at: updated_page1.first().cloned().flatten(),
|
||||
},
|
||||
ThreadItem {
|
||||
@@ -777,6 +781,7 @@ async fn test_pagination_cursor() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-03-04T09-00-00".into()),
|
||||
recency_at: updated_page1.get(1).cloned().flatten(),
|
||||
updated_at: updated_page1.get(1).cloned().flatten(),
|
||||
},
|
||||
],
|
||||
@@ -831,6 +836,7 @@ async fn test_pagination_cursor() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-03-03T09-00-00".into()),
|
||||
recency_at: updated_page2.first().cloned().flatten(),
|
||||
updated_at: updated_page2.first().cloned().flatten(),
|
||||
},
|
||||
ThreadItem {
|
||||
@@ -849,6 +855,7 @@ async fn test_pagination_cursor() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-03-02T09-00-00".into()),
|
||||
recency_at: updated_page2.get(1).cloned().flatten(),
|
||||
updated_at: updated_page2.get(1).cloned().flatten(),
|
||||
},
|
||||
],
|
||||
@@ -895,6 +902,7 @@ async fn test_pagination_cursor() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some("2025-03-01T09-00-00".into()),
|
||||
recency_at: updated_page3.first().cloned().flatten(),
|
||||
updated_at: updated_page3.first().cloned().flatten(),
|
||||
}],
|
||||
next_cursor: None,
|
||||
@@ -1066,6 +1074,7 @@ async fn test_get_thread_contents() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some(ts.into()),
|
||||
recency_at: page.items[0].updated_at.clone(),
|
||||
updated_at: page.items[0].updated_at.clone(),
|
||||
}],
|
||||
next_cursor: None,
|
||||
@@ -1421,6 +1430,7 @@ async fn test_timestamp_only_cursor_skips_same_second_filesystem_ties() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some(ts.to_string()),
|
||||
recency_at: updated_page1.first().cloned().flatten(),
|
||||
updated_at: updated_page1.first().cloned().flatten(),
|
||||
},
|
||||
ThreadItem {
|
||||
@@ -1439,6 +1449,7 @@ async fn test_timestamp_only_cursor_skips_same_second_filesystem_ties() {
|
||||
model_provider: Some(TEST_PROVIDER.to_string()),
|
||||
cli_version: Some("test_version".to_string()),
|
||||
created_at: Some(ts.to_string()),
|
||||
recency_at: updated_page1.get(1).cloned().flatten(),
|
||||
updated_at: updated_page1.get(1).cloned().flatten(),
|
||||
},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user