Skip to content

Respect delivery boundaries for injected agent messages - #58988

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/70f49cbe5074725c11e1fcb33eea05e0e92e17f7
Nov 2, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/70f49cbe5074725c11e1fcb33eea05e0e92e17f7

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Respect delivery boundaries for injected agent messages

Why

Injected agent messages need to reach active sampling before stale tool calls execute, while messages queued around a final answer must wait for the next task without requesting another response.

What changed

  • Include injected agent_message items in mailbox preemption checks when the matching turn still accepts mail and DeferMailboxPreemption is disabled.
  • Treat injected agent messages as queue-only mail so they do not reopen delivery after a final answer or force a follow-up response.

Testing

Add a streaming scenario and context snapshot covering idle injection, active sampling preemption, deferred delivery around a final answer, and preservation of message payloads and ordering before the next task.

## Why

Injected agent messages need to reach active sampling before stale tool calls execute, while messages queued around a final answer must wait for the next task without requesting another response.

## What changed

- Include injected `agent_message` items in mailbox preemption checks when the matching turn still accepts mail and `DeferMailboxPreemption` is disabled.
- Treat injected agent messages as queue-only mail so they do not reopen delivery after a final answer or force a follow-up response.

## Testing

Add a streaming scenario and context snapshot covering idle injection, active sampling preemption, deferred delivery around a final answer, and preservation of message payloads and ordering before the next task.

GitOrigin-RevId: 70f49cbe5074725c11e1fcb33eea05e0e92e17f7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/70f49cbe5074725c11e1fcb33eea05e0e92e17f7 branch from 63babe7 to ac21e58 Compare November 2, 2026 21:36
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-02T21:36:09.108886Z 63babe7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit ac21e58 into main Nov 2, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/70f49cbe5074725c11e1fcb33eea05e0e92e17f7 branch November 2, 2026 21:36
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant