mirror of
https://github.com/openai/codex.git
synced 2026-11-16 06:54:36 +00:00
Enable paginated thread history in app-server (#33364)
## What changed - Allow `thread/start` to select experimental `historyMode: "paginated"` when the thread store supports turn and item pagination. - Resume paginated threads with bounded model context and require `excludeTurns: true` instead of loading full history. - Return `turnsBackwardsCursor` and `itemsBackwardsCursor` from `thread/resume` so clients can hydrate durable history through `thread/turns/list` and `thread/items/list` while newer records arrive through live notifications. - Reject operations that still require full history, including `initialTurnsPage`, `thread/read` with `includeTurns: true`, `thread/rollback`, and detached review. - Make item cursors independent of the optional `turnId` filter. ## Testing - Cover paginated thread start, cold and live resume, backwards cursor hydration, metadata reads, unsupported operations, and stores without pagination support. GitOrigin-RevId: c42f9b268e29d049843330f474fa3ecde12f5b8a
This commit is contained in:
1 parent
1bbdb32789
commit
da61f7d8e1
26 files changed
+758
-138
No files matched your search
@@ -89,7 +89,7 @@ pub(super) fn write_session_file_with_fork(
|
||||
fs::create_dir_all(&day_dir)?;
|
||||
let path = day_dir.join(format!("rollout-{ts}-{uuid}.jsonl"));
|
||||
let mut file = fs::File::create(&path)?;
|
||||
let meta = serde_json::json!({
|
||||
let mut meta = serde_json::json!({
|
||||
"timestamp": ts,
|
||||
"type": "session_meta",
|
||||
"payload": {
|
||||
@@ -110,6 +110,9 @@ pub(super) fn write_session_file_with_fork(
|
||||
}
|
||||
},
|
||||
});
|
||||
if matches!(history_mode, ThreadHistoryMode::Paginated) {
|
||||
meta["ordinal"] = serde_json::json!(0);
|
||||
}
|
||||
writeln!(file, "{meta}")?;
|
||||
if matches!(history_mode, ThreadHistoryMode::Legacy) {
|
||||
let user_event = serde_json::json!({
|
||||
|
||||
Reference in new issue
Block a user