Skip to content

fix: wait_agent timeout for queued mailbox mail#18968

Merged
jif-oai merged 1 commit intomainfrom
jif/glitched-mailbox
Apr 22, 2026
Merged

fix: wait_agent timeout for queued mailbox mail#18968
jif-oai merged 1 commit intomainfrom
jif/glitched-mailbox

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 22, 2026

Why

wait_agent can be called while mailbox mail is already pending. The previous implementation subscribed for future mailbox sequence changes and then waited for the next notification. If the mail was queued before that wait started, no new notification arrived, so the tool could sit until timeout_ms even though mail was ready to deliver.

What Changed

  • Added Session::has_pending_mailbox_items() for checking pending mailbox mail through the session API.
  • Updated multi_agents_v2::wait to return immediately when pending mailbox mail already exists before sleeping on a new mailbox sequence update.
  • Reworked the regression coverage in multi_agents_tests.rs so already queued mailbox mail must wake wait_agent promptly.

Relevant code:

Verification

  • cargo test -p codex-core multi_agent_v2_wait_agent_returns_for_already_queued_mail

@jif-oai jif-oai requested a review from a team as a code owner April 22, 2026 09:50
@jif-oai jif-oai changed the title fix: mailbox wait timeout fix: wait_agent timeout for queued mailbox mail Apr 22, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 22, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai jif-oai merged commit 6393826 into main Apr 22, 2026
24 of 25 checks passed
@jif-oai jif-oai deleted the jif/glitched-mailbox branch April 22, 2026 10:16
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 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