-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1123,6 +1123,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike { | |
| role: "user", | ||
| content: [{ type: "text", text: `[new_task completed] Result: ${lastMessage}` }], | ||
| }) | ||
|
|
||
| // 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } catch (error) { | ||
| this.providerRef | ||
| .deref() | ||
|
|
||
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?