mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Reduce session submission channel memory with boxed payloads (#61389)
## Why The bounded submission channel reserves all slots at session startup, including space for a full `Submission` in each slot. ## What changed Send `Box<Submission>` through the channel so each slot reserves only pointer-sized payload storage, allocating full submissions as needed. Update submission producers, delegate forwarding, and test helpers to pass boxed submissions, and unbox them in the submission loop. GitOrigin-RevId: d8d9c613683076d74fcb3e2f2cb6244c5857bca2
This commit is contained in:
@@ -305,7 +305,7 @@ pub(crate) async fn run_codex_thread_one_shot(
|
||||
let _ = tx_bridge.send(event).await;
|
||||
if should_shutdown {
|
||||
let _ = ops_tx
|
||||
.send(Submission {
|
||||
.send(Box::new(Submission {
|
||||
id: "shutdown".to_string(),
|
||||
op: Op::Shutdown {},
|
||||
turn_extension_init: None,
|
||||
@@ -314,7 +314,7 @@ pub(crate) async fn run_codex_thread_one_shot(
|
||||
root_turn_id: None,
|
||||
residency_guard: None,
|
||||
message_delivery: None,
|
||||
})
|
||||
}))
|
||||
.await;
|
||||
child_cancel.cancel();
|
||||
break;
|
||||
@@ -415,7 +415,7 @@ async fn forward_event_or_shutdown(
|
||||
/// Forward ops from a caller to a sub-agent, respecting cancellation.
|
||||
async fn forward_ops(
|
||||
io: Arc<SessionIo>,
|
||||
rx_ops: Receiver<Submission>,
|
||||
rx_ops: Receiver<Box<Submission>>,
|
||||
cancel_token_ops: CancellationToken,
|
||||
) {
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user