Skip to content

Conversation

@joshka-oai
Copy link
Collaborator

@joshka-oai joshka-oai commented Dec 12, 2025

fix(core): gate unified exec output streaming

Context

CI for openai/codex#7601 exposed two issues with unified exec output collection:

  • suite::shell_snapshot::linux_unified_exec_uses_shell_snapshot failed on ubuntu‑24.04‑arm with stdout="\n" instead of the expected snapshot-linux marker. 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_notifications timed out waiting for TaskComplete because the collection loop waited the full yield_time_ms after an early exit, stalling silent commands.

What’s changing

  • Only start ExecCommandOutputDelta streaming after the session is confirmed alive, so early‑exit commands don’t emit delta events.
  • When a process exits quickly, wait a short grace window for initial stdout so short‑lived commands (like the shell snapshot) can flush output.
  • Treat whitespace‑only output as “still empty” so a lone newline doesn’t prevent the longer grace window on slower/ARM runners.

Why this is correct

These changes balance two competing behaviors:

  • Capture meaningful output from fast‑exiting commands (e.g., snapshot generation).
  • Avoid stalling turn completion when commands are silent (which caused the TaskComplete timeout).

The grace window is short and only applied after exit, preserving responsiveness while making output capture more robust.

Tests/CI signal

  • Previously failing:
    • 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 for TaskComplete)
  • With this change, the viewport PR’s CI went green, indicating these failure modes are resolved.

Files touched

  • core/src/unified_exec/session_manager.rs

@joshka-oai joshka-oai force-pushed the joshka/unified-exec-output branch from f16b7b8 to f5c9b2c Compare December 12, 2025 19:40
Only start streaming output once a session stays alive so early-exit commands
avoid ExecCommandOutputDelta events. After exit, wait a short grace for initial
stdout, treating whitespace-only output as still empty so slower runners capture
snapshot markers without stalling silent commands.
@joshka-oai joshka-oai force-pushed the joshka/unified-exec-output branch from f5c9b2c to d2646d7 Compare December 12, 2025 19:45
@joshka-oai joshka-oai marked this pull request as ready for review December 12, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants