-
Notifications
You must be signed in to change notification settings - Fork 41
fix: message timestamps not being accurate #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added logic to set a timestamp for AGUI events in `agui_proxy.go` and `agui.go` if not already present, ensuring accurate message tracking. - Updated `compaction.go` to preserve the timestamp from events when creating messages. - Modified frontend components to utilize the timestamp from backend messages, providing a fallback for legacy messages. This change improves the reliability of message timestamp tracking across the system.
Claude Code ReviewSummaryThis PR fixes a critical timestamp tracking issue in the AG-UI event streaming system. Previously, all messages in a session would display the timestamp of the most recently received message. The fix ensures that each message captures its own timestamp at the point it's created/received, both on the backend (Go) and frontend (TypeScript). Overall Assessment: ✅ Approved with Minor Recommendations The implementation correctly addresses the stated problem following established patterns. The changes are minimal, focused, and backwards-compatible. Issues by Severity🚫 Blocker IssuesNone - This PR is ready to merge. 🔴 Critical IssuesNone identified. 🟡 Major Issues1. Inconsistent Timestamp Format Handling (
2. Duplicate Timestamp Assignment Logic (
🔵 Minor Issues1. Comment Clarity (
2. Missing Test Coverage
3. Frontend Type Safety (
Positive Highlights✅ Excellent Pattern Adherence:
✅ Strategic Placement:
✅ Backwards Compatibility:
✅ Good Comments:
✅ Minimal Scope:
RecommendationsPriority 1: Before Merge
Priority 2: Follow-up PR
Priority 3: Future Improvement
Architecture Compliance✅ Backend Standards (CLAUDE.md):
✅ Frontend Standards:
Testing VerificationManual Testing Needed:
Automated Testing Recommendations: // Add to components/backend/websocket/agui_test.go
func TestEventTimestampPreservation(t *testing.T) {
event := map[string]interface{}{
"type": "text.message.start",
"messageId": "msg-123",
}
// Should add timestamp if missing
RouteAGUIEvent("test-session", event)
if event["timestamp"] == nil {
t.Error("Expected timestamp to be set")
}
originalTimestamp := event["timestamp"]
time.Sleep(10 * time.Millisecond)
// Should NOT overwrite existing timestamp
event["timestamp"] = originalTimestamp
RouteAGUIEvent("test-session", event)
if event["timestamp"] \!= originalTimestamp {
t.Error("Timestamp was unexpectedly modified")
}
}Security Review✅ No security concerns identified
Performance Impact✅ Minimal performance impact
Final VerdictRecommendation: ✅ APPROVE with minor improvements This PR correctly solves the stated problem. The timestamp tracking implementation is sound and follows most established patterns. The suggested improvements are for code quality and maintainability, not correctness. Before Merge:
After Merge:
Great work on identifying and fixing this UX issue! The message timestamps will now correctly reflect when each message was created rather than all showing the most recent message time. 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Still need to test this with an updated backend, but this should add per-message timestamps to the eventstream from AGUI, enabling us to show accurate per-message timestamps. Right now all message timestamps in a session change to the time of the most recently received message.