Skip to content

Conversation

@tikazyq
Copy link
Collaborator

@tikazyq tikazyq commented Nov 11, 2025

No description provided.

Copilot AI and others added 30 commits August 27, 2025 03:22
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…-820c-2ebb78495a45

Implement document upload and management system for AI agents
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…tion improvements

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…% reduction)

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…-aa10-dc3033ec42f1

Complete TypeORM to Prisma migration with functional services and smart fallback system
- Introduced `PrismaServiceBase` to encapsulate shared logic for Prisma services.
- Updated `PrismaDevlogService` and `PrismaProjectService` to extend from `PrismaServiceBase`.
- Implemented singleton pattern with TTL-based cleanup for service instances.
- Simplified Prisma client initialization and fallback handling.
- Removed redundant initialization logic from individual services.
- Enhanced lifecycle hooks for better extensibility and maintainability.
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Add comprehensive solution for handling different AI agent log formats:
- Implement pluggable Agent Adapter Pattern with base interface
- Add detailed adapter examples (Copilot, Claude)
- Update implementation checklist with adapter development tasks
- Expand architecture diagrams to show adapter layer
- Document adapter development guide and strategy

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…rvability

Design: Add comprehensive AI Coding Agent Observability system documentation
…ility

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Copilot AI and others added 26 commits November 2, 2025 07:27
…y assessment

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
… Complete)

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…ability-readme

Update README to reflect actual implementation status (~40-45% complete)
…d], POST /api/events

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…Session

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…oints to use correct relations

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…TCH endpoint clarity

Co-authored-by: tikazyq <3393101+tikazyq@users.noreply.github.com>
…endpoints

Implement missing API endpoints and fix AgentEvent→AgentSession schema relation
…updated test metrics

Update AI Agent Observability and MVP launch specs to mark all 10 API endpoints implemented and tested:
- bump Phase 1 progress to 95% and mark API layer 100% complete
- add explicit list of implemented routes (sessions/events, batch, stream) and integration test status
- update frontend integration and real-time streaming TODOs and "Last Updated" notes

Also update test-infrastructure spec:
- set updated timestamp to "Evening"
- correct test results to 150/193 (78%) passing and failing count
- reduce estimated effort remaining and clarify auth service isolation issue
…update observability README

Add a SQL migration that drops the incorrect agent_events.session_id foreign key and re-adds it to
reference agent_sessions(id) with ON UPDATE/DELETE CASCADE. This corrects the schema relation
previously pointing to chat_sessions.

Add E2E_TEST_RESULTS.md documenting end-to-end validation (DB, API, Go collector, SSE) and update
the ai-agent-observability README to reflect the DB fix, E2E success, updated progress, and next
steps for Go collector deployment and historical backfill.
…r compatibility and align event shape

- web/api/events/batch: auto-create missing machines, workspaces and agent sessions when ingesting collector events (upsert machines/workspaces, bulk create sessions) to improve collector compatibility and idempotency
- collector/adapters/copilot: add workspaceID and parsed projectID to adapter, include agentVersion and projectId in generated events, only apply hierarchy context when ProjectID > 0, minor formatting/logging fixes
- collector/client: flush batch before canceling context, suppress logs for context.Canceled, send raw event array to /api/events/batch and /api/events (updated URLs), improve retry/backoff logging
- collector/types: align AgentEvent shape (rename eventType, add agentVersion, make projectId required) to match API payload
- prisma/schema: remove problematic btree index on JSONB data field and add note to create GIN index via raw migration
…support

Document failure case where response[].value can be an array, propose using json.RawMessage
and content/value handling, include parsing strategy (string/array), implementation plan,
and test/validation checklist to ensure backward-compatible parsing of new Copilot formats.
…lot collector array-value spec

- Change Phase 1 to "Investigation ✅ Complete" and record findings (reproduction, failing file, root cause)
- Update Phase 2 to "Ready to start" and expand success criteria and timeline
- Move and expand Investigation Findings section with format evolution details and impact
- Add concrete file/line references and test-file details for follow-up implementation/tests
…in response items

- change CopilotResponseItem.Value to json.RawMessage and add CopilotContent to represent nested content
- add extractValueAsString helper to flexibly parse string/array/null values
- update response extraction to use the new helper (handle array-valued responses)
- update tests to use json.RawMessage, add unit tests for array/value parsing and a real-sample check
- include testdata/copilot-array-value.json sample for array-value scenarios
… add implementation summary

- Update README.md status to "complete" and convert Phase 2 to ✅ Complete with results/test coverage
- Document implemented changes: Value -> json.RawMessage, CopilotContent, extractValueAsString(), parsing updates
- Add implementation.md with detailed summary, test fixtures, test results and next steps
- Created SESSION_SUMMARY.md detailing objectives achieved, test results, and insights discovered.
- Documented environment setup, agent session and event service tests, refactoring guide, and documentation updates.
- Highlighted key insights on mock vs real database patterns and field name conventions.

feat: Implement support for array values in Copilot collector

- Added README.md and implementation.md for Copilot Collector Array Value Support.
- Updated CopilotResponseItem struct to handle both string and array types using json.RawMessage.
- Implemented parsing logic to extract values from both formats without data loss.

chore: Remove outdated ORGANIZATION.md

- Deleted ORGANIZATION.md as it was no longer relevant to the current specs structure.

docs: Revise README.md for specs directory

- Updated directory structure to reflect flat organization.
- Enhanced utility scripts section for better spec management.
- Clarified document structure and required frontmatter for specs.
- Documented objectives achieved, test results, and work completed.
- Highlighted key insights and lessons learned during the session.
- Established next steps for Phase 3 execution.

fix: Implement array value support in Copilot collector

- Updated CopilotResponseItem struct to handle both string and array values.
- Added parsing logic to extract values correctly from recent chat formats.
- Ensured backward compatibility with existing files.

chore: Remove outdated organization guide

- Deleted ORGANIZATION.md as part of restructuring efforts.
- Updated README.md to reflect new flat directory structure and management commands.
- Introduced performance summary document outlining MVP recommendations, performance comparisons, and implementation phases.
- Created quick reference guide detailing core concepts, key features, architecture, event types, data models, and best practices for AI Agent Observability.
…mpleted tasks for project folder restructure
Copilot AI review requested due to automatic review settings November 11, 2025 14:16
@tikazyq tikazyq merged commit 2509728 into main Nov 11, 2025
4 of 7 checks passed
@tikazyq tikazyq deleted the develop branch November 11, 2025 14:16
Copy link

Copilot AI left a 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 a comprehensive Go-based collector for AI agent observability, introducing real-time log monitoring, offline buffering, and hierarchical event tracking across multiple agent types (GitHub Copilot, Claude, Cursor).

Key Changes:

  • Go collector with adapter-based architecture for multiple AI agents
  • Hierarchy system (Projects → Machines → Workspaces → Sessions → Events)
  • Real-time file watching with offline SQLite buffering
  • Backfill capability for historical log processing
  • Configuration management with environment variable support

Reviewed Changes

Copilot reviewed 153 out of 375 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/collector/internal/hierarchy/cache.go Hierarchy cache for workspace context resolution with concurrent-safe operations
packages/collector/internal/config/config.go Configuration management with validation and environment variable expansion
packages/collector/internal/client/hierarchy.go HTTP client for machine/workspace/project hierarchy operations
packages/collector/internal/buffer/buffer.go SQLite-based offline event buffering with FIFO eviction
packages/collector/internal/backfill/backfill.go Historical log processing with resumable state tracking
packages/collector/internal/adapters/copilot_adapter.go GitHub Copilot chat session parser with array value support
packages/collector/internal/adapters/claude_adapter.go Claude Desktop JSONL log parser
packages/collector/internal/adapters/cursor_adapter.go Cursor AI log parser with flexible format detection
packages/collector/cmd/collector/main.go CLI with start/backfill commands and progress reporting
packages/collector/go.mod Go module dependencies including SQLite and testing libraries
package.json Root package.json with Prisma dependencies
docker-compose.yml Updated environment variables for Prisma migration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +569 to +571
// TODO: Implement actual duplicate detection using event hash
// For now, return false (no deduplication)
// In production, this should check against a hash index in the buffer
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isDuplicate function is a stub that always returns false, which could lead to duplicate events being processed. This should either be implemented or have a clear tracking issue reference in the TODO comment.

Suggested change
// TODO: Implement actual duplicate detection using event hash
// For now, return false (no deduplication)
// In production, this should check against a hash index in the buffer
// Check for duplicate using event hash in buffer
hash := eventHash(event)
if bm.buffer != nil && bm.buffer.HasEventHash != nil {
return bm.buffer.HasEventHash(hash)
}
// TODO: Proper deduplication requires buffer hash index support.
// Tracking issue: https://github.com/codervisor/devlog/issues/123

Copilot uses AI. Check for mistakes.
Comment on lines +99 to +100
hiererchyCache := hierarchy.NewHierarchyCache(nil, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hiererchyCache, log)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in variable name 'hiererchyCache' should be 'hierarchyCache'

Suggested change
hiererchyCache := hierarchy.NewHierarchyCache(nil, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hiererchyCache, log)
hierarchyCache := hierarchy.NewHierarchyCache(nil, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hierarchyCache, log)

Copilot uses AI. Check for mistakes.
Comment on lines +358 to +359
hiererchyCache := hierarchy.NewHierarchyCache(apiClient, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hiererchyCache, log)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in variable name 'hiererchyCache' should be 'hierarchyCache'

Suggested change
hiererchyCache := hierarchy.NewHierarchyCache(apiClient, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hiererchyCache, log)
hierarchyCache := hierarchy.NewHierarchyCache(apiClient, log)
registry := adapters.DefaultRegistry(cfg.ProjectID, hierarchyCache, log)

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33
// Parse projectID string to int, default to 215 for testing
projID := 215
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded magic number 215 as default project ID. This should be configurable or use a constant with clear documentation explaining why 215 is the test default.

Copilot uses AI. Check for mistakes.
Comment on lines +180 to +182
if config.Buffer.MaxSize < 100 || config.Buffer.MaxSize > 100000 {
return fmt.Errorf("buffer.maxSize must be between 100 and 100000")
}
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers 100 and 100000 for buffer size limits should be extracted as named constants (e.g., MinBufferSize and MaxBufferSize) for better maintainability.

Copilot uses AI. Check for mistakes.
currentOffset := state.LastByteOffset
lastProgressUpdate := time.Now()
errorCount := 0
maxErrorsToLog := 10
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic number 10 for maximum errors to log should be extracted as a constant or made configurable for different debugging needs.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants