mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
codex: migrate (more) app-server thread history reads to ThreadStore (#20575)
Migrate token usage replay, rollback responses, and detached review setup (a special case of forking) to be served from ThreadStore reads rather direct rollout files. - replay restored token usage from already-loaded `RolloutItem` history instead of reopening `Thread.path` - rebuild rollback responses from loaded `ThreadStore` snapshots and history - start detached reviews from store-backed parent history and stored review-thread metadata - remove obsolete app-server rollout-summary helper code that became dead after the store-backed migration - preserve response/notification ordering for resume, fork, rollback, and detached review flows - add integration test coverage for the affected paths
This commit is contained in:
@@ -413,6 +413,23 @@ impl CodexThread {
|
||||
live_thread.load_history(include_archived).await
|
||||
}
|
||||
|
||||
pub async fn read_thread(
|
||||
&self,
|
||||
include_archived: bool,
|
||||
include_history: bool,
|
||||
) -> ThreadStoreResult<StoredThread> {
|
||||
let live_thread = self
|
||||
.codex
|
||||
.session
|
||||
.live_thread_for_persistence("read thread")
|
||||
.map_err(|err| ThreadStoreError::Internal {
|
||||
message: err.to_string(),
|
||||
})?;
|
||||
live_thread
|
||||
.read_thread(include_archived, include_history)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn update_thread_metadata(
|
||||
&self,
|
||||
patch: ThreadMetadataPatch,
|
||||
|
||||
Reference in New Issue
Block a user