-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: skip previousResponseId for GPT-5 after subtask completion #7253
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 1 commit
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 |
|---|---|---|
|
|
@@ -1107,6 +1107,17 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike { | |
| role: "user", | ||
| content: [{ type: "text", text: `[new_task completed] Result: ${lastMessage}` }], | ||
| }) | ||
|
|
||
| // When using GPT-5 with the responses API, we need to skip the previous_response_id | ||
| // for the next API call after a subtask completes, similar to what happens after | ||
| // a condense operation. This ensures the conversation continuity is properly maintained. | ||
| const modelId = this.api.getModel().id | ||
| if (modelId && modelId.startsWith("gpt-5")) { | ||
|
||
| this.skipPrevResponseIdOnce = true | ||
| this.providerRef | ||
| .deref() | ||
| ?.log(`[GPT-5] Skipping previous_response_id for next API call after subtask completion`) | ||
| } | ||
| } 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.
Nice work following the existing pattern from condense operations! The inline comment clearly explains why this is necessary for GPT-5.