[codex] emit outbound events for streamed results#29
Merged
DorianZheng merged 1 commit intomainfrom Apr 9, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
This PR makes AgentLite expose streamed outbound messages through the SDK event surface.
It adds a shared outbound send helper in
AgentImplthat:message.outevent with the final text and timestampExisting internal outbound paths now use that helper, including streamed container output, scheduler-delivered messages, IPC-delivered messages, and remote-control responses.
It also adds regression tests covering
message.outemission and ensuring internal-only content stays suppressed.Why it changed
The runtime already supported intermittent agent output at the container level, but SDK consumers did not get a clean outbound event when those chunks were actually delivered.
message.outwas part of the public event types, but the implementation did not emit it.Impact
Consumers can now subscribe to
agent.on('message.out', ...)and observe partial/intermittent outbound messages consistently across the existing send paths.Root cause
Outbound delivery logic was duplicated across a few internal paths and bypassed the public
message.outevent entirely.Validation
npm test -- --run src/message-events.test.ts src/container-runner.test.tsnpm test -- --run src/task-scheduler.test.tsprettier --write "src/**/*.ts"