From d06d9702087e113ebce8d33b7bbb2cd78e4cbdbf Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Thu, 21 Aug 2025 22:16:16 -0500 Subject: [PATCH] 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 --- src/core/task/Task.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 9d57912040..104cb87206 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1123,6 +1123,10 @@ export class Task extends EventEmitter 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()