Simplify code-mode cell completion delivery (#57229)

## What changed

Remove unused pending initial-yield state and its plumbing from cell completion handling. Route completion delivery through `send_cell_event`, retaining the completion event and original timestamp when an observer has disconnected.

## Testing

Extend `failed_completion_delivery_rebuffers_the_event` to verify that failed delivery attempts preserve output and report the full elapsed buffering duration on a later successful observation.

GitOrigin-RevId: eebe990a4f8258f1ccb12d0694945678f0cc3a8f
This commit is contained in:
Channing Conger
2026-10-26 20:18:45 +00:00
committed by copyberry
parent 7948c07531
commit 0b021a5fc9
6 changed files with 51 additions and 283 deletions
@@ -287,7 +287,6 @@ impl<D: SessionRuntimeDelegate> CellHost for RuntimeCellHost<D> {
&self,
stored_value_writes: HashMap<String, Arc<JsonValue>>,
event: CellEvent,
pending_initial_yield_items: Option<Vec<OutputItem>>,
cell_state: Arc<CellState>,
) -> CompletionCommit {
let cancellation_token = cell_state.cancellation_token();
@@ -298,7 +297,7 @@ impl<D: SessionRuntimeDelegate> CellHost for RuntimeCellHost<D> {
}
stored_values = self.inner.stored_values.lock() => stored_values,
};
cell_state.commit_completion(event, pending_initial_yield_items, || {
cell_state.commit_completion(event, || {
stored_values.extend(stored_value_writes);
})
}
@@ -119,7 +119,6 @@ async fn termination_rejects_a_waiting_store_commit_before_the_next_cell_can_loa
Arc::new(JsonValue::String("lost".to_string())),
)]),
completion.clone(),
/*pending_initial_yield_items*/ None,
Arc::clone(&cell_state),
);
tokio::pin!(commit);