Skip to content

fix: preserve pending async calls in committed sessions - #6039

Merged
seratch merged 3 commits into
mainfrom
codex/f52-preserve-pending-async-session-calls
Nov 17, 2026
Merged

seratch merged 3 commits into
mainfrom
codex/f52-preserve-pending-async-session-calls

Conversation

@ashwinnathan-openai

@ashwinnathan-openai ashwinnathan-openai commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Imported session history:
  [Reasoning A]
  [Async function/custom call: call_id=call_123, async=true]
  [Reasoning B]

  Call status: completed, omitted, or null.
  The model finished emitting the call; the external job is still running.
  There is no tool output yet.

             Next Runner request (session read or approval/resume)
                                     |
                  +------------------+------------------+
                  |                                     |
                BEFORE                                AFTER
                  |                                     |
       No output -> treat as orphan        Recognize valid pending async call
       Drop call + tied Reasoning A        Keep call + tied Reasoning A
                  |                                     |
       Next Responses request:             Next Responses request:
         [Reasoning B]                       [Reasoning A]
                                             [Async function/custom call]
                                             [Reasoning B]

       Pending call lost from replay       Pending call retained for replay
                                           Later output uses call_123

  Scope: committed history and its approval/resume snapshot.
  SDK-generated orphan, retry, and failed-write cleanup stay strict.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T05:15:48.281709Z cc94cf0 New commits
🔒 Security Review ✅ Completed 2026-11-17T05:16:26.910952Z cc94cf0 New commits
ℹ️ 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.

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for narrowing this to committed session reads. One case still loses the pending call and its preceding reasoning. The pinned OpenAI client defines async on ResponseCustomToolCall, but its output and replay input types have no status field. The current test adds "status": "completed" to the custom call, and another test explicitly expects the statusless form to be pruned.

Please accept a committed custom_tool_call with async: true, a nonempty call_id, and no status. Update the session replay test to use a serialized ResponseCustomToolCall and assert that the next model request includes both the call and its preceding reasoning before the output arrives.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 244ebe8598

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

@seratch
seratch disabled auto-merge November 17, 2026 14:07
@seratch
seratch added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit f48003a Nov 17, 2026
26 checks passed
@seratch
seratch deleted the codex/f52-preserve-pending-async-session-calls branch November 17, 2026 14:14
@openai-sdks openai-sdks Bot mentioned this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants