You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
Assistant message timestamps were inconsistent across reloads:
- **Before reload**: All parts showed the timestamp of the first message
- **After reload**: All parts showed the timestamp of the last message
(or Date.now())
This happened because:
1. Text/reasoning parts weren't getting timestamps during streaming
(unlike tool parts)
2. Display logic used message-level timestamp instead of part-level
timestamps
3. Reconnection case was overwriting metadata.timestamp with Date.now()
## Solution
- Add `timestamp` field to text/reasoning parts during streaming
(matching tool parts)
- Preserve first timestamp when merging adjacent parts of the same type
- Use `part.timestamp ?? baseTimestamp` when displaying (consistent with
tool parts)
- Preserve `metadata.timestamp` in reconnection case instead of
overwriting
## Testing
Added comprehensive tests covering:
- Timestamp assignment during streaming
- Timestamp preservation when displaying
- Fallback to message-level timestamp for old history without part-level
timestamps
All existing tests pass.
_Generated with `cmux`_
0 commit comments