Skip to content

Commit d06d970

Browse files
authored
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
1 parent 4222036 commit d06d970

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/task/Task.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
11231123
role: "user",
11241124
content: [{ type: "text", text: `[new_task completed] Result: ${lastMessage}` }],
11251125
})
1126+
1127+
// Set skipPrevResponseIdOnce to ensure the next API call sends the full conversation
1128+
// including the subtask result, not just from before the subtask was created
1129+
this.skipPrevResponseIdOnce = true
11261130
} catch (error) {
11271131
this.providerRef
11281132
.deref()

0 commit comments

Comments
 (0)