code-mode: preserve initial yield at completion#29289
Conversation
f2cf22e to
78a5993
Compare
289b79d to
4439ee8
Compare
| .commit_completion( | ||
| HashMap::new(), | ||
| event, | ||
| /*pending_initial_yield_items*/ None, |
There was a problem hiding this comment.
This slice never supplies a real initial yield: both production completion call sites still pass None, and only the direct state tests construct Some(...)
Is this expected? This does not seems aligned with the PR title
There was a problem hiding this comment.
This is unfortunately preparatory for #29290 they could likely have been merged.
78a5993 to
aeac9d7
Compare
4439ee8 to
acb5941
Compare
aeac9d7 to
01fa5b8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acb5941852
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .commit_completion( | ||
| stored_value_writes, | ||
| event, | ||
| /*pending_initial_yield_items*/ None, |
There was a problem hiding this comment.
Preserve the first dropped yield at completion
When the initial YieldAfter response is dropped before the actor can deliver a yield_control() boundary and the cell then runs to completion before another observation, this path still commits the completion with pending_initial_yield_items set to None. The failed yield delivery is only folded back into content_items, so the next YieldAfter observe receives one merged Completed event instead of the preserved Yielded boundary followed by the buffered completion; the new CellState buffering is only exercised by tests that call commit_completion(..., Some(...)) directly, not by the actor. Capture the first undelivered initial yield, including an empty yield, and pass it into the completion commit here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
We address this later, good catch though.
acb5941 to
7dc6da8
Compare
Summary
yield_control()boundary when a cell completes before observation.Why
Create followed by the initial wait must preserve the former execute response boundary even when the script runs to completion first.
Impact
The first wait observes the same initial yield boundary as before create and observe were decoupled.
Validation
just test -p codex-code-mode -p codex-code-mode-protocol(70 passed).cconger/code-mode-runtime-compact-03e2-observation-delivery.