Skip to content

Commit 9ceeb97

Browse files
committed
fix local codex review comment:
- [P0] Always capture previousResponseId — packages/agents-core/src/run.ts:1791-1796 When we start a Responses conversation without an explicit conversationId or previousResponseId, trackServerItems should capture the first response ID so that follow-up turns can pass it back to the API. The new guard this.previousResponseId !== undefined prevents that first assignment, so previousResponseId stays undefined forever and second turn requests go up without any conversation context even though we only send the delta. That means the model loses all history and breaks server-managed conversation flows. Please drop that guard and always record the latest response ID whenever conversationId is absent.
1 parent 46989c1 commit 9ceeb97

File tree

1 file changed

+1
-5
lines changed
  • packages/agents-core/src

1 file changed

+1
-5
lines changed

packages/agents-core/src/run.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,11 +1799,7 @@ class ServerConversationTracker {
17991799
this.serverItems.add(item);
18001800
}
18011801
}
1802-
if (
1803-
!this.conversationId &&
1804-
this.previousResponseId !== undefined &&
1805-
modelResponse.responseId
1806-
) {
1802+
if (!this.conversationId && modelResponse.responseId) {
18071803
this.previousResponseId = modelResponse.responseId;
18081804
}
18091805
}

0 commit comments

Comments
 (0)