WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Galaxy-0
Copy link
Contributor

Problem

When processing parallel tool calls, drain_in_flight was recording output items one by one as they completed. This created a race condition where the conversation history could be in an inconsistent state (containing a tool call without its corresponding output) if inspected by a background task (like auto-compact or seatbelt) during the draining process. This resulted in "tool_call_id missing response" errors (GitHub Issue #8479).

Solution

Modified drain_in_flight in core/src/codex.rs to:

  1. Collect all completed tool outputs from the current batch into a Vec.
  2. Record them to the conversation history in a single atomic record_conversation_items call.

Validation

  • cargo check -p codex-core passed.
  • cargo clippy -p codex-core passed.
  • cargo test -p codex-core passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant