Repository navigation
Commit 937665a
committed
fix(session): use parentID instead of timestamp for loop exit condition
Replace timestamp-based comparison with parentID check to prevent duplicate
assistant responses caused by clock skew between client and server.
When client and server have different system times, the ID-based comparison
lastUser.id < lastAssistant.id fails, causing the prompt loop to continue
and generate a second assistant response.
This fix uses the explicit parentID relationship to determine if the
assistant message is a response to the last user message, which is
immune to clock skew issues.
For backward compatibility, the timestamp comparison is kept as a
fallback for messages that may not have parentID set.
Fixes anomalyco#149351 parent 3c96bf8 commit 937665a
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
1377 | | - | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1378 | 1385 | | |
1379 | 1386 | | |
1380 | 1387 | | |
| |||
0 commit comments