fix: ensure subtask results are provided to GPT-5 in OpenAI Responses API (#7305)

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
This commit is contained in:
Daniel 2025-08-21 22:16:16 -05:00 committed by GitHub
parent 4222036c58
commit d06d970208
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
} catch (error) {
this.providerRef
.deref()