fix(responses): resolve #3075 — Bug: server-side compaction is not emitted on Responses#3417
fix(responses): resolve #3075 — Bug: server-side compaction is not emitted on Responses#3417Sudhanwa-git wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ac532dd93
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| from typing_extensions import TypeAlias | ||
|
|
||
| from .response_function_call_output_item import ResponseFunctionCallOutputItem | ||
| from .response_function_call_output_item import ResponseFunctionCallOutputItem, Compaction |
There was a problem hiding this comment.
Import the generated compaction model
When the Responses types are imported, this line now tries to import Compaction from response_function_call_output_item, but that module only defines ResponseFunctionCallOutputItem; the generated compaction model lives in response_compaction_item.py as ResponseCompactionItem. As a result, importing openai.types.responses or lazily loading the client.responses resource fails before any response parsing can happen.
Useful? React with 👍 / 👎.
Summary
Fixes #3075 — Bug: server-side compaction is not emitted on Responses tool-call-only turns
Root Cause
The
ResponseFunctionCallOutputItemListtype alias is defined as a list ofResponseFunctionCallOutputItem, but it does not include thecompactionitem when onlyfunction_callis returned.Changes
response_function_call_output_item_list.py— patched the root-cause code pathVerification
Automated fix — please review before merging.