-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Phase 2 Interactive Features: Session Details Page and Real-Time Updates via SSE #50
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
|
@copilot continue with next step |
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Completed Phase 2.3: Multi-Project Support! 🎉 What's New:
Phase 2 is now complete with all three sub-phases implemented: Changes in commit c7792df. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements Phase 2 interactive features for the agent observability system, adding session details pages, real-time updates via Server-Sent Events (SSE), and multi-project filtering capabilities.
Key Changes:
- Added session details page with comprehensive metrics and event timeline
- Implemented SSE-based real-time updates for dashboard statistics
- Added multi-project support with URL-based filtering across all views
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/lib/realtime/event-broadcaster.ts | Singleton broadcaster for managing SSE connections and broadcasting events to clients |
| apps/web/lib/hooks/use-realtime-events.ts | React hook for consuming SSE streams with auto-reconnection logic |
| apps/web/components/agent-observability/project-selector.tsx | Client component for project filtering with URL state management |
| apps/web/components/agent-observability/dashboard/live-dashboard-stats.tsx | Real-time dashboard stats component with SSE integration |
| apps/web/components/agent-observability/dashboard/dashboard-stats-wrapper.tsx | Server component wrapper for fetching initial dashboard data |
| apps/web/components/agent-observability/session-details/*.tsx | Components for displaying session header, metrics, and event timeline |
| apps/web/app/sessions/[id]/page.tsx | Session details page with parallel data fetching |
| apps/web/app/api/events/stream/route.ts | SSE endpoint for streaming real-time updates |
| apps/web/app/api/sessions/[id]/*.ts | API routes for session details and events |
| apps/web/app/api/dashboard/*.ts | Updated dashboard APIs to support optional projectId filtering |
Comments suppressed due to low confidence (1)
apps/web/app/api/dashboard/stats/route.ts:1
- The variable
statsFilterusesanytype without justification. According to coding guidelines,anytype should be avoided unless explicitly justified. Consider defining a proper type for the stats filter.
/**
| this.clients.delete(controller); | ||
| } | ||
|
|
||
| broadcast(event: string, data: any) { |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter data uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider using a more specific type or unknown with type guards.
| * broadcastEvent('event.created', { sessionId: '123', type: 'file_write' }); | ||
| * ``` | ||
| */ | ||
| export function broadcastEvent(event: string, data: any) { |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter data uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider using a more specific type or unknown with type guards.
|
|
||
| const eventSourceRef = useRef<EventSource | null>(null); | ||
| const reconnectTimeoutRef = useRef<NodeJS.Timeout | null>(null); | ||
| const listenersRef = useRef<Map<string, Set<(data: any) => void>>>(new Map()); |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback parameter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider using a generic type parameter or unknown with type guards.
| onDisconnected?.(); | ||
| }, [onDisconnected]); | ||
|
|
||
| const subscribe = useCallback((eventType: string, callback: (data: any) => void) => { |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback parameter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider using a generic type parameter or unknown with type guards.
| const eventFilter: any = { | ||
| startTime: today, | ||
| endTime: tomorrow, | ||
| }); | ||
| }; |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable eventFilter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider defining a proper type for the event filter.
| const recentFilter: any = { | ||
| startTime: oneHourAgo, | ||
| }); | ||
| }; |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable recentFilter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider defining a proper type for the event filter.
| await eventService.initialize(); | ||
|
|
||
| // Build event filter | ||
| const eventFilter: any = { limit }; |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable eventFilter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider defining a proper type for the event filter.
|
|
||
| // Build filter | ||
| const filter: any = { projectId, limit, offset }; | ||
| const filter: any = { limit, offset }; |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable filter uses any type without justification. According to coding guidelines, any type should be avoided unless explicitly justified. Consider defining a proper type for the session filter.
Phase 2: Interactive Features Implementation
Continuing implementation of Phase 2 features from PR #49 NEXT_STEPS.md
✅ Completed Features
Phase 2.1: Session Details Page (Complete)
/sessions/[id]/page.tsx- Complete session view with header, metrics, and timeline/api/sessions/[id]/route.ts- Session details API endpoint/api/sessions/[id]/events/route.ts- Session events API with filteringPhase 2.2: Real-Time Updates via SSE (Complete)
/api/events/stream- SSE endpoint with persistent connectionsEventBroadcaster- Singleton for server-side event broadcastinguseRealtimeEventshook - Client-side SSE consumer with auto-reconnectionLiveDashboardStats- Real-time dashboard with connection status indicatorPhase 2.3: Multi-Project Support ✅ (Complete)
projectIdquery parameter/api/dashboard/stats- Now supports projectId filter/api/dashboard/activity- Now supports projectId filter/api/sessions- Now supports projectId filterProjectSelectorcomponent - Dropdown for filtering by project📊 Implementation Details
Multi-Project Support Features:
?projectId=123)Bug Fixes:
API Route Updates:
All routes now accept an optional
projectIdquery parameter:GET /api/dashboard/stats?projectId=1- Dashboard metrics for specific projectGET /api/dashboard/activity?projectId=1- Recent activity for specific projectGET /api/sessions?projectId=1- Sessions for specific projectprojectIdis omitted, data is aggregated across all projectsProject Selector Component:
/api/projectsendpoint🎨 UI Changes
The dashboard and sessions pages now display a project selector dropdown in the top right of the header. Users can:
🏗️ Technical Architecture
✅ Build Status
📝 Files Changed
New Files (1):
apps/web/components/agent-observability/project-selector.tsx- Project selector componentModified Files (10):
apps/web/app/api/dashboard/stats/route.ts- Added projectId parameter supportapps/web/app/api/dashboard/activity/route.ts- Added projectId parameter supportapps/web/app/api/sessions/route.ts- Added projectId parameter supportapps/web/app/dashboard/page.tsx- Added ProjectSelector, pass searchParamsapps/web/app/sessions/page.tsx- Added ProjectSelector, pass searchParamsapps/web/components/agent-observability/dashboard/dashboard-stats-wrapper.tsx- Accept and use projectIdapps/web/components/agent-observability/dashboard/recent-activity.tsx- Accept and use projectIdapps/web/components/agent-observability/dashboard/active-sessions.tsx- Accept and use projectIdapps/web/components/agent-observability/sessions/sessions-list.tsx- Accept and use projectIdapps/web/components/agent-observability/project-selector.tsx- Fixed infinite re-render bug🎯 Phase 2 Complete!
All three sub-phases of Phase 2 are now implemented and tested:
Total Changes in Phase 2:
Next Steps:
Continue with Phase 3 (Enhanced Filtering & Search) or Phase 4 (Analytics & Insights) as needed.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.