[Bug]: Visible turn items collide when inherited and local share an id#27860
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/client-runtime
Steps to reproduce
Open a forked/child thread whose visible timeline includes an inherited row and a local row that share the same sourceItemId (different sourceThreadId).
- Stream a
turn-item.updatedfor the local item. - Or hide the local item (for example a rolled-back run update that removes it from the visible list).
- Or expand deferred work anchored on that shared id.
Expected behavior
Only the local (sourceThreadId, sourceItemId) row is updated, hidden, or used as the deferred-work anchor. The inherited row stays put. Equal-ordinal deferred rows keep a stable id order.
Actual behavior
Upsert/remove and deferred-work lookup match on sourceItemId alone, so the inherited row can be overwritten, removed, or chosen as the anchor. Deferred equal-ordinal sorting also lacks an id tie-break.
Impact
Incorrect timeline rows in forked threads when ids collide across source threads.