-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ensure subtask results are provided to GPT-5 in OpenAI Responses API #7305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… API When a subtask completes and the parent task resumes, set skipPrevResponseIdOnce = true to ensure the next API call sends the full conversation including the subtask result. This fixes the issue where GPT-5 would only receive the new message without the subtask result context when using previous_response_id. Fixes #7251
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this fix! I've reviewed the changes and the solution correctly addresses the issue where subtask results weren't being provided to GPT-5 when using the OpenAI Responses API.
The fix follows the established pattern already used for context condensation, which gives confidence in the approach. The implementation is minimal and focused, addressing exactly what's needed.
|
|
||
| // Set skipPrevResponseIdOnce to ensure the next API call sends the full conversation | ||
| // including the subtask result, not just from before the subtask was created | ||
| this.skipPrevResponseIdOnce = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix! This correctly ensures the full conversation history is sent after a subtask completes. The pattern matches what's done for context condensation (line 2415), which is a proven approach.
One suggestion: Consider adding a test case that specifically verifies subtask results are included in the GPT-5 API call when using the Responses API. This would help prevent regression of this issue.
| }) | ||
|
|
||
| // Set skipPrevResponseIdOnce to ensure the next API call sends the full conversation | ||
| // including the subtask result, not just from before the subtask was created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment clearly explains why this flag is being set. Since this pattern (skipping previous_response_id after context changes) is now used in multiple places (here and line 2415 for condensation), would it be worth documenting this behavior pattern in a more central location or perhaps extracting it into a helper method for consistency?
Description
This PR fixes issue #7251 where subtask results were not being provided to GPT-5 when using the OpenAI Responses API with the
previous_response_idmechanism.Problem
When a subtask completes and the parent task resumes, the next API call was using a
previous_response_idfrom before the subtask was created. This caused GPT-5 to only receive the new message without the subtask result context, as the API would only provide messages after the specifiedprevious_response_id.Solution
Set
skipPrevResponseIdOnce = truein theresumePausedTask()method after adding the subtask result to the conversation history. This ensures the next API call sends the full conversation including the subtask result, following the same pattern used after context condensation.Changes
this.skipPrevResponseIdOnce = trueinTask.tsline 1129 after the subtask result is added to the API conversation historyTesting
The fix follows the established pattern already used in the codebase for context condensation scenarios where we need to ensure the full context is sent.
Fixes #7251
Important
Fixes issue #7251 by ensuring subtask results are included in the next API call to GPT-5 in
resumePausedTask()inTask.ts.resumePausedTask()inTask.ts.skipPrevResponseIdOnce = trueafter adding subtask result to conversation history to ensure full context is sent.This description was created by
for 235a144. You can customize this summary. It will automatically update as commits are pushed.