Skip to content

Commit f4ceeba

Browse files
authored
core/compact: stop locking Session.state; use Session::record_into_hi… (#4170)
…story during streaming # External (non-OpenAI) Pull Request Requirements Before opening this Pull Request, please read the dedicated "Contributing" markdown file or your PR may be closed: https://github.com/openai/codex/blob/main/docs/contributing.md If your PR conforms to our contribution guidelines, replace this text with a detailed and high quality description of your changes.
1 parent 55abf54 commit f4ceeba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

codex-rs/core/src/codex/compact.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ async fn drain_to_completed(
267267
};
268268
match event {
269269
Ok(ResponseEvent::OutputItemDone(item)) => {
270-
let mut state = sess.state.lock().await;
271-
state.record_items(std::slice::from_ref(&item));
270+
sess.record_into_history(std::slice::from_ref(&item)).await;
272271
}
273272
Ok(ResponseEvent::Completed { .. }) => {
274273
return Ok(());

0 commit comments

Comments
 (0)