mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Include directly attached threads in diagnostic uploads (#57824)
## What changed When a diagnostic upload includes logs, include saved threads attached directly to the reported thread in the existing bounded thread selection alongside spawned descendants. Query attached threads from the state database, including archived threads, so their rollouts, logs, and retained review failures can be collected. Log a warning and continue if the lookup fails. ## Testing Extend the upload integration test to verify that the rollout archive includes the reported and directly attached threads, excludes unrelated threads, and is omitted when logs are disabled. GitOrigin-RevId: 1bcd2794938339fb4b1c433c3731f507601cd8a4
This commit is contained in:
@@ -134,6 +134,22 @@ WHERE id = ? AND preview = ''
|
||||
Ok(result.rows_affected() > 0)
|
||||
}
|
||||
|
||||
/// List saved threads attached directly to the given parent, including archived threads.
|
||||
pub async fn list_attached_thread_ids(
|
||||
&self,
|
||||
parent: ThreadId,
|
||||
) -> anyhow::Result<Vec<ThreadId>> {
|
||||
let ids = sqlx::query_scalar::<_, String>(
|
||||
"SELECT id FROM threads WHERE attached_thread_parent_id = ?",
|
||||
)
|
||||
.bind(parent.to_string())
|
||||
.fetch_all(self.pool.as_ref())
|
||||
.await?;
|
||||
ids.into_iter()
|
||||
.map(|id| ThreadId::try_from(id).map_err(Into::into))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Persist or replace the directional parent-child edge for a spawned thread.
|
||||
pub async fn upsert_thread_spawn_edge(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user