Skip to content

fix(conversation): upsert streaming tool calls (AIO-30)#484

Open
TCP404 wants to merge 1 commit into
mainfrom
boii/fix/aio-30
Open

fix(conversation): upsert streaming tool calls (AIO-30)#484
TCP404 wants to merge 1 commit into
mainfrom
boii/fix/aio-30

Conversation

@TCP404

@TCP404 TCP404 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Multica issue: AIO-30

Root Cause

Streaming tool-call persistence used separate read/update/insert branches. Concurrent or out-of-order events for the same message ID could either hit a duplicate primary key error or lose fields when an update arrived before the initial insert.

Changes

  • Added a repository-level message upsert for messages.id conflicts.
  • Implemented SQLite INSERT ... ON CONFLICT(id) DO UPDATE with JSON merge semantics.
  • Preserved terminal finish / error status when late work events arrive.
  • Routed ACP and aionrs tool-call persistence through the upsert path.
  • Added regression coverage for out-of-order ACP and aionrs tool-call events.

Verification

  • cargo test -p aionui-db
  • cargo test -p aionui-conversation
  • cargo clippy -p aionui-db -- -D warnings
  • cargo clippy -p aionui-conversation -- -D warnings

- Persist ACP and aionrs tool-call events through an atomic message upsert
- Merge JSON content on duplicate message IDs while preserving terminal status
- Cover out-of-order ACP and aionrs tool-call event persistence
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