Skip to content

Improve message reconciliation - #231

Open
renal128 wants to merge 3 commits into
swift6from
message-reconciliation
Open

Improve message reconciliation#231
renal128 wants to merge 3 commits into
swift6from
message-reconciliation

Conversation

@renal128

@renal128 renal128 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Turns out that event_id is not a unique ID - there can be multiple agent responses with the same event_id (e.g. if theres agent utterance, tool call and another agent utterance in the same turn). So we didn't have a good way to match streamed events. Recently we added responseId in the backend as unique identifiers of agent utterances, so we can match them properly, which is the focus of this PR:

  • Reconcile agent streams, full responses, and corrections by response_id (one turn can produce several agent messages).
  • Replace messages with chatHistory: a mixed, stable list of messages and tool calls, that can be extended with other types of entries in the future.

Test plan

  • unit tests
  • manual tests

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 22791f0. Configure here.

@renal128
renal128 force-pushed the message-reconciliation branch from 22791f0 to a86df21 Compare August 22, 2026 15:06
Co-authored-by: Cursor <cursoragent@cursor.com>
@renal128
renal128 force-pushed the message-reconciliation branch from a86df21 to ae071f1 Compare August 22, 2026 15:40
@renal128 renal128 changed the title Replace messages with a response_id-keyed chatHistory Chat History reliability Aug 22, 2026
renal128 and others added 2 commits August 22, 2026 17:40
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@renal128 renal128 changed the title Chat History reliability Improve message reconciliation Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant