Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, targeted server bug fix that associates assistant completions with the correct provider item and includes focused regression coverage for interleaved Codex messages. Existing matching behavior remains intact, with no schema, configuration, deployment, or sensitive-package changes. You can add or adjust custom eligibility rules. Learn more. |
e0bb5bc to
f4be4d7
Compare
|
Note: GPT-6 on behalf of shivam (@shivamhwp). Please rebase the item-ID match onto the current completion handler while preserving its direct projection queries. Current main uses Use the existing |
Codex emits
send_user_message_asyncas a separate completed agent message during an active turn. Provider ingestion always matched assistant completions to the active streamed segment, so it discarded the async message text whenever commentary was already buffered.This matches completions to active segments by provider item ID. A different item now becomes its own assistant message while the original segment stays active. Focused coverage reproduces buffered commentary, an async message, and the original completion in one turn.
Fixes #9222.
Verification
vp test run apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts(51 passed)Implemented with
gpt-5.6-solin the Codex harness through T3 Code.Note
Medium Risk
Changes assistant message completion and segment lifecycle in provider ingestion, which affects how all multi-item turns are projected; scope is narrow but message ordering/content is user-visible.
Overview
Fixes Codex async assistant messages (
send_user_message_async) being dropped when a turn already had buffered/streaming commentary on another item.Provider runtime ingestion now ties
item.completedfor assistant messages to the active segment only when the completion’s provider item id matches that segment’sbaseKey. A completion for a different item finalizes as its own assistant message and no longer reuses or overwrites the in-flight segment. Segment state is cleared only when the completing event matches that active segment, so commentary can keep streaming after an interleaved async message completes.Adds an integration test that streams commentary, completes a separate async assistant item, then completes the commentary item and asserts both texts appear in the thread projection.
Reviewed by Cursor Bugbot for commit f4be4d7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix async assistant message preservation in
ProviderRuntimeIngestionAssistant completion events were updating the wrong active message when a turn contained separate async assistant messages. The completion handler now matches the active assistant segment by its segment base key, and derives the assistant message ID from that matching segment. Segment state is cleared only when a matching completing segment is found.
Macroscope summarized f4be4d7.