Currently, GPT suggestions are stored on the most recent item. This can lead to issues where a delay causes old suggestions to be saved to the most recent request. To prevent this, we need to implement a mechanism where a terminalStateID is passed with each request. When the response is ready, the result should be stored in result[terminalStateID].
Proposed Solution:
Modify the request to include a terminalStateID.
Upon receiving the GPT response, store the result in result[terminalStateID] instead of the most recent item.
This change will ensure that suggestions are correctly matched to their respective terminal states, preventing any issues caused by delays.
Description:
Currently, GPT suggestions are stored on the most recent item. This can lead to issues where a delay causes old suggestions to be saved to the most recent request. To prevent this, we need to implement a mechanism where a
terminalStateID
is passed with each request. When the response is ready, the result should be stored inresult[terminalStateID]
.Proposed Solution:
terminalStateID
.result[terminalStateID]
instead of the most recent item.This change will ensure that suggestions are correctly matched to their respective terminal states, preventing any issues caused by delays.