Add rollout path to memory files and search for them during read (#12684)

Co-authored-by: jif-oai <jif@openai.com>
This commit is contained in:
Wendy Jiao
2026-02-26 02:57:01 -08:00
committed by GitHub
Unverified
parent 6acede5a28
commit 52aa49db1b
6 changed files with 39 additions and 7 deletions
+4
View File
@@ -12,6 +12,7 @@ use super::ThreadMetadata;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Stage1Output {
pub thread_id: ThreadId,
pub rollout_path: PathBuf,
pub source_updated_at: DateTime<Utc>,
pub raw_memory: String,
pub rollout_summary: String,
@@ -23,6 +24,7 @@ pub struct Stage1Output {
#[derive(Debug)]
pub(crate) struct Stage1OutputRow {
thread_id: String,
rollout_path: String,
source_updated_at: i64,
raw_memory: String,
rollout_summary: String,
@@ -35,6 +37,7 @@ impl Stage1OutputRow {
pub(crate) fn try_from_row(row: &SqliteRow) -> Result<Self> {
Ok(Self {
thread_id: row.try_get("thread_id")?,
rollout_path: row.try_get("rollout_path")?,
source_updated_at: row.try_get("source_updated_at")?,
raw_memory: row.try_get("raw_memory")?,
rollout_summary: row.try_get("rollout_summary")?,
@@ -51,6 +54,7 @@ impl TryFrom<Stage1OutputRow> for Stage1Output {
fn try_from(row: Stage1OutputRow) -> std::result::Result<Self, Self::Error> {
Ok(Self {
thread_id: ThreadId::try_from(row.thread_id)?,
rollout_path: PathBuf::from(row.rollout_path),
source_updated_at: epoch_seconds_to_datetime(row.source_updated_at)?,
raw_memory: row.raw_memory,
rollout_summary: row.rollout_summary,
+2 -1
View File
@@ -218,7 +218,7 @@ LEFT JOIN jobs
///
/// Query behavior:
/// - filters out rows where both `raw_memory` and `rollout_summary` are blank
/// - joins `threads` to include thread `cwd`
/// - joins `threads` to include thread `cwd` and `rollout_path`
/// - orders by `source_updated_at DESC, thread_id DESC`
/// - applies `LIMIT n`
pub async fn list_stage1_outputs_for_global(
@@ -233,6 +233,7 @@ LEFT JOIN jobs
r#"
SELECT
so.thread_id,
COALESCE(t.rollout_path, '') AS rollout_path,
so.source_updated_at,
so.raw_memory,
so.rollout_summary,