fix(orchestrator): Batch compatible queued Codex command completions#25

draft1
contrib/ctm/delegated-completion-settle-race
contrib/ctm/codex-background-batching
openedSep 27, 2026byMMike Olson
View on GitHubTwo-way sync enabledPR last imported 8h ago

What Changed

When several Codex background commands finish while a turn is running, their completion notifications now merge into the one already queued instead of each queuing its own turn. The combined notification reads "Background commands finished", includes every command's output, and reports the most severe outcome. It keeps the first notification's place in the queue, so it can run ahead of a user message queued after that first notification. The user message itself is never changed or consumed.

Only notifications with the same sender, model selection and provider thread merge. User messages, delegated-completion wakes and scheduled or context-bearing messages never absorb a batch.

Why

Each finished command started a separate Codex turn, so a burst of background commands produced a string of short turns that each re-read the thread. One combined turn gives the agent all the results at once.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Added 1 commit

  • fix(orchestrator): Batch compatible queued Codex command completions6789796