Context
PR #375 revealed a DateTime.UtcNow vs DateTime.Now mismatch in the orchestration dispatch path (N5 finding). The fix was to use DateTime.Now to match ChatMessage.Timestamp convention, but this is a band-aid — the codebase uses mixed conventions.
Current state
ChatMessage.Timestamp uses DateTime.Now (local time)
PendingOrchestration.StartedAt uses DateTime.UtcNow
- Resume path has manual
ToLocalTime() conversion
- Dispatch path now uses
DateTime.Now after the N5 fix
Proposed fix
- Standardize all persisted/logical timestamps to
DateTimeOffset.UtcNow
- Convert to local time only in UI display layers
- Update
ChatMessage.Timestamp, PendingOrchestration.StartedAt, and all comparison sites
- Ensure events.jsonl timestamps are parsed consistently
Risk
This is a data migration — existing persisted sessions have local timestamps in events.jsonl. Need a migration path or dual-parsing.
Priority
Low — current code works correctly after the N5 fix, but the mixed convention is a recurring source of bugs.