Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion codex-rs/state/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ ON CONFLICT(id) DO UPDATE SET
return Ok(());
}
let thread_id = thread_id.to_string();
let mut tx = self.pool.begin().await?;
for (idx, tool) in tools.iter().enumerate() {
let position = i64::try_from(idx).unwrap_or(i64::MAX);
let input_schema = serde_json::to_string(&tool.input_schema)?;
Expand All @@ -439,9 +440,10 @@ ON CONFLICT(thread_id, position) DO NOTHING
.bind(tool.name.as_str())
.bind(tool.description.as_str())
.bind(input_schema)
.execute(self.pool.as_ref())
.execute(&mut *tx)
.await?;
}
tx.commit().await?;
Ok(())
}

Expand Down
Loading