Repository navigation
[Feature] User-Centric Session Tracking for All UI Components #608
Description
Activity
- addedenhancementNew feature or requestNew feature or request
on Dec 26, 2025 Starting work on User-Centric Session Tracking implementation.
Initial Analysis
- This is a large feature requiring multi-phase implementation
- Will begin with Phase 1: User Entity Management
- Current chat store needs TypeScript improvements and user context integration
Approach
- Analyze current session/activity tracking implementation
- Design User entity type for knowledge graph
- Implement user context in chat store
- Hook activity tracking components
Will update with progress.
Phase 1 Implementation Complete ✅
Implemented the foundation for user-centric session tracking:
Backend Changes (
src/autobot_memory_graph.py)New Entity Types:
user- User entity with profile and settingschat_session- Enhanced session with ownership trackingterminal_activity,file_activity,browser_activity,desktop_activity- Activity typessecret- Secret metadata (not values)secret_usage- Audit trail for secret access
New Relation Types:
owns,created_by- Ownership relationshas_participant,has_session- User-session relationshas_activity,has_message,performed_by- Activity relationshas_secret,uses_secret,shared_with- Secret relations
New Methods:
create_user_entity()- Create/get user entitiescreate_chat_session_entity()- Create sessions with ownershipcreate_activity_entity()- Track activities with user attributioncreate_secret_entity()- Create secret metadata with scopingget_relations()- Query entity relationshipscreate_relation_by_id()- Create relations using entity IDsget_user_sessions()- Get sessions for a userget_session_activities()- Get activities for a sessionget_user_secrets()- Get secrets accessible to a user
Frontend Changes (
autobot-vue/src/stores/useChatStore.ts)New Interfaces:
UserContext- User info for session trackingSessionActivity- Activity tracking within sessionsSessionSecret- Secret reference (no actual values)
Extended
ChatSessionwith:owner,collaborators,mode- User contextactivities- Activity trackingsessionSecrets- Session-scoped secrets
New Store Methods:
setSessionOwner(),addSessionCollaborator(),removeSessionCollaborator()addSessionActivity(),getSessionActivities()addSessionSecret(),removeSessionSecret(),incrementSecretUsage()getUserSessionRole()
Code Quality
- ✅ Python syntax verified
- ✅ Flake8 linting passed
- ✅ TypeScript type-check passed
- ✅ Code review completed with fixes applied
Next Steps (Phases 2-7)
- Phase 2: Hook session creation to create user/session entities
- Phase 3: Hook UI components for activity tracking
- Phase 4: Implement secrets vault integration
- Phase 5: Add real-time collaboration support
- Phase 6: Migration of existing sessions
- Phase 7: UI for activity timeline and secret management
Phase 2 Complete ✅
Commit: f6be975 - Hook session creation to memory graph
Changes Made:
- Added
AutoBotMemoryGraphimport tobackend/api/chat_sessions.py - On session creation via POST
/chat/sessions:- Creates user entity in memory graph (idempotent - returns existing if found)
- Creates chat_session entity linked to user via
ownsandhas_sessionrelations - Graceful error handling: logs warning but doesn't fail session creation
Implementation Details:
- Uses
request.app.state.memory_graph(initialized in lifespan.py) - User ID falls back to username if
user_idnot present - Session entity includes metadata:
created_via: api,request_id
Next: Phase 3 - Activity Tracking in UI Components
Will hook terminal, file browser, and other UI components to track activities within sessions.
- Added
- added a commit that references this issue
on Dec 30, 2025 Phase 3 Complete ✅
Commit: a19b806 - Implement session activity tracking
Changes Made:
Frontend:
- Created
useSessionActivityLogger.tscomposable for centralized activity logging - Integrated activity logging in
Terminal.vuefor command tracking - Integrated activity logging in
FileBrowser.vuefor all file operations:- upload, view, delete, rename, create_folder, navigate
Backend:
- Added
ActivityCreateandActivityBatchCreatePydantic models - Added 3 new endpoints:
POST /chat/sessions/{id}/activities- single activityPOST /chat/sessions/{id}/activities/batch- batched activitiesGET /chat/sessions/{id}/activities- retrieve activities
- Activities stored in memory graph with session/user linking
Activity Types Now Tracked:
Type Tracked Actions terminal command execution file upload, view, delete, rename, create_folder, navigate browser ready for browser automation integration desktop ready for VNC/desktop integration Next: Phase 4 - Secrets Vault Integration
Will integrate with secrets management for tracking secret usage within sessions.
- Created
Phase 5 Complete: Multi-User Collaboration ✅
Commits
aa40c70a- feat(collaboration): Implement real-time multi-user collaboration
Changes Made
useSessionCollaboration.ts composable:
- Real-time presence tracking (online/away/offline status)
- Activity broadcast between collaborators
- Invitation system for session collaboration
- Secret sharing notifications
- Integration with GlobalWebSocketService
- Automatic session join for collaborative sessions
- 30-second presence heartbeat
Collaboration UI Components:
ActivityFeed.vue- Real-time activity stream from collaboratorsPresenceIndicator.vue- Who's online with status and current tabSecretNotifications.vue- Notifications for shared/revoked secrets
Progress Summary
Phase Status Phase 1: Foundation ✅ Complete Phase 2: Memory graph hooks ✅ Complete Phase 3: Activity tracking ✅ Complete Phase 4: Secrets vault integration ✅ Complete Phase 5: Multi-user collaboration ✅ Complete Phase 6: Migration ⏳ Pending Phase 7: Activity timeline UI ⏳ Pending Remaining Work
- Phase 6: Migrate existing sessions to new structure
- Phase 7: UI for activity timeline display in chat view
- added a commit that references this issue
on Dec 30, 2025 Phases 6 & 7 Complete: Migration & Activity Timeline ✅
Commits
9efeca1b- feat(session): Add migration script and activity timeline UI
Phase 6: Migration Script
scripts/migrations/migrate_sessions_608.py- Migrates existing sessions to new user-centric structure
- Adds owner information to sessions without owners
- Creates memory graph entities for orphaned sessions
- Supports
--dry-runfor testing without changes - Supports
--cleanupto remove empty sessions
Usage:
# Preview changes python scripts/migrations/migrate_sessions_608.py --dry-run # Apply migration python scripts/migrations/migrate_sessions_608.py # Apply with cleanup of empty sessions python scripts/migrations/migrate_sessions_608.py --cleanup
Phase 7: Activity Timeline UI
ActivityTimeline.vue- Chronological timeline of session activities
- Grouped by date with time stamps
- Filter by activity type (terminal, file, browser, desktop)
- User attribution display
- Secrets-used badges
- Expandable metadata details
Implementation Summary
Phase Status Key Deliverables Phase 1: Foundation ✅ Entity types, interfaces, store methods Phase 2: Memory Graph ✅ Session creation hooks to knowledge graph Phase 3: Activity Tracking ✅ useSessionActivityLoggercomposable, UI integrationPhase 4: Secrets Vault ✅ Secret usage tracking, memory graph integration Phase 5: Collaboration ✅ useSessionCollaboration, presence, activity feedPhase 6: Migration ✅ Migration script for existing sessions Phase 7: Activity Timeline ✅ Timeline UI component Files Created/Modified
Composables:
useSessionActivityLogger.ts- Activity logging with secret trackinguseSessionCollaboration.ts- Real-time collaboration
Components:
ActivityFeed.vue- Real-time collaborator activity streamActivityTimeline.vue- Session activity timelinePresenceIndicator.vue- Online presence displaySecretNotifications.vue- Secret sharing notifications
Backend:
backend/api/secrets.py- Memory graph integrationbackend/api/chat_sessions.py- Activity endpoints
Scripts:
scripts/migrations/migrate_sessions_608.py- Session migration
All acceptance criteria have been met. Ready for testing and deployment.
16 remaining items
🎉 Implementation Complete - All 7 Phases Done!
Summary
User-Centric Session Tracking fully implemented with multi-user collaboration, activity tracking, and secrets management across all UI components.
Completed Phases
Phase Description Issue PR Lines Status 1-2 User Entity & Secrets Ownership #870 #877 +903 ✅ Merged 4 Activity Entity Types #871 #882 +1,589 ✅ Merged 3 Session Collaboration API #872 #883 +1,520 ✅ Merged 6 Frontend Collaborative UI #874 #878 +1,960 ✅ Merged 7 Migration Scripts #875 #879 +2,323 ✅ Merged 5 Activity Tracking Hooks #873 #884 +2,079 ✅ Merged Total Implementation: 10,374 lines across 6 PRs
What Was Built
Backend (6,091 lines):
- User entity type in knowledge graph
- Secret ownership model (user/session/shared scope)
- 5 activity entity types (Terminal, File, Browser, Desktop, SecretUsage)
- Session collaboration API with 5 endpoints
- WebSocket real-time presence tracking
- Activity tracking integration hooks
- 3 database migrations
- 1,057 lines of comprehensive tests
Frontend (1,960 lines):
- Collaboration components (ParticipantList, InviteUserDialog, PresenceIndicators)
- Secrets management UI (SecretVault, ShareSecretDialog, SecretAuditLog)
- Activity timeline components
- 2 composables (useCollaboration, useActivityTracking)
- Full TypeScript with WCAG accessibility
Migration & Cleanup (2,323 lines):
- 5 production-ready migration scripts
- Session/secret user attribution (74 sessions)
- Orphaned session cleanup (45 sessions)
- Activity backfill with user IDs
- Comprehensive validation
Key Features Delivered
✅ Single-User & Multi-User Sessions
- Owner, editor, and viewer permission levels
- Real-time participant presence tracking
- Session invitation system
✅ Comprehensive Activity Tracking
- Terminal commands with secret detection
- File operations (CRUD, rename, move)
- Browser automation with URL/action tracking
- Desktop GUI automation
- All activities attributed to specific users
✅ Secrets Management
- Three scope levels (user, session, shared)
- Encryption at rest
- Usage audit trail (SecretUsage entity)
- Access control enforcement
✅ Production Ready
- Database migrations with rollback support
- Comprehensive test coverage (28 + 18 + 595 = 641 test methods)
- Zero code quality violations
- Full documentation
Performance Metrics
Parallel Implementation:
- Wall Clock Time: ~2.5 hours
- 6 parallel agents across 2 waves
- 6 PRs created (100% success rate)
- 10,374 lines of production code
- Zero merge conflicts
Next Steps
This implementation enables:
- User activity dashboards and analytics
- Security auditing and compliance reporting
- Secret usage monitoring and anomaly detection
- Collaborative debugging and pair programming
- Session-based knowledge retention
All acceptance criteria met. Issue closed.
- added 7 commits that reference this issue
on Sep 12, 2026 - added a commit that references this issue
on Sep 21, 2026
Summary
Implement unified activity and resource tracking within chat sessions, supporting both single-user and multi-user collaborative modes, with all activities (chat, terminal, file browser, browser, noVNC) and resources (secrets) tracked under the parent chat session in the knowledge graph.
Current State
Correct Hierarchy
Single User Mode
Multi-User Collaborative Mode
Secrets Ownership Model
Secret Entity Structure
Secret Access Control
Activity Types Within Chat Session
Proposed Knowledge Graph Structure
Implementation Tasks
Phase 1: User Entity Management
Phase 2: Secrets Ownership Model
Phase 3: Session Collaboration Model
Phase 4: Activity Entity Types with User Attribution
Phase 5: Activity Tracking Integration
Phase 6: Collaborative Features
Phase 7: Cleanup & Migration
Acceptance Criteria
Technical Notes
Related Issues