fix(core): gate unified exec output streaming #7905
+14
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(core): gate unified exec output streaming
Context
CI for
openai/codex#7601exposed two issues with unified exec output collection:suite::shell_snapshot::linux_unified_exec_uses_shell_snapshotfailed on ubuntu‑24.04‑arm withstdout="\n"instead of the expectedsnapshot-linuxmarker. This indicates we sometimes capture only a partial/whitespace chunk from short‑lived commands before the remaining stdout arrives.suite::unified_exec::unified_exec_respects_early_exit_notificationstimed out waiting forTaskCompletebecause the collection loop waited the fullyield_time_msafter an early exit, stalling silent commands.What’s changing
ExecCommandOutputDeltastreaming after the session is confirmed alive, so early‑exit commands don’t emit delta events.Why this is correct
These changes balance two competing behaviors:
TaskCompletetimeout).The grace window is short and only applied after exit, preserving responsiveness while making output capture more robust.
Tests/CI signal
suite::shell_snapshot::linux_unified_exec_uses_shell_snapshot(stdout only"\n"on ubuntu‑24.04‑arm)suite::unified_exec::unified_exec_respects_early_exit_notifications(timeout waiting forTaskComplete)Files touched
core/src/unified_exec/session_manager.rs