Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jul 11, 2025

Summary

This PR adds comprehensive error telemetry to the code-index service while ensuring user privacy and maintaining code consistency.

Changes

Error Telemetry

  • Added error tracking across all code-index components:
    • File scanning and processing errors
    • Embedding generation failures
    • Cache operation errors
    • Search service errors
    • Orchestration and coordination failures

Privacy Protection

  • File paths are now hashed using SHA-256 before being sent in telemetry events to protect user privacy
  • No sensitive file content or actual file paths are exposed in telemetry data

Code Consistency

  • Standardized all telemetry-related import paths to use @shared/types/telemetry throughout the codebase
  • Eliminated inconsistent relative imports for better maintainability

Testing

  • All existing tests pass
  • Added comprehensive test coverage for error scenarios
  • Verified telemetry events are properly formatted with hashed file paths
  • Import resolution works correctly in all environments

Related Issues


Important

Adds comprehensive error telemetry to code-index service, ensuring privacy by hashing file paths and standardizing telemetry imports.

  • Error Telemetry:
    • Added error tracking for file scanning, embedding generation, cache operations, search service, and orchestration failures.
    • Implemented in cache-manager.ts, manager.ts, and orchestrator.ts.
  • Privacy Protection:
    • File paths hashed using SHA-256 before sending in telemetry events.
    • No sensitive file content or paths exposed in telemetry.
  • Code Consistency:
    • Standardized telemetry import paths to @shared/types/telemetry.
    • Eliminated inconsistent relative imports.
  • Testing:
    • All existing tests pass.
    • Added test coverage for error scenarios.
    • Verified telemetry events format with hashed paths.
    • Import resolution verified in all environments.

This description was created by Ellipsis for 07ebf19. You can customize this summary. It will automatically update as commits are pushed.

@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners July 11, 2025 13:51
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jul 11, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 11, 2025

No security or compliance issues detected. Reviewed everything up to 07ebf19.

Security Overview
  • 🔎 Scanned files: 25 changed file(s)
Detected Code Changes
Change Type Relevant files
Refactor ► file-watcher.ts
    Simplify error handling in code indexing system
► validation-helpers.ts
    Add error message sanitization
► cache-manager.ts
    Add telemetry for error handling
► manager.ts
    Add telemetry for error reporting
Enhancement ► telemetry.ts
    Add CODE_INDEX_ERROR event

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@daniel-lxs daniel-lxs marked this pull request as draft July 11, 2025 13:53
@daniel-lxs daniel-lxs force-pushed the feat/add-code-index-error-telemetry branch from 2c82d75 to 51de1b0 Compare July 11, 2025 14:21
- Add new CODE_INDEX_ERROR telemetry event type
- Implement error tracking across all code-index components:
  - Scanner: track file scanning and processing errors
  - Parser: track parsing failures and language detection issues
  - File watcher: track file system monitoring errors
  - Orchestrator: track coordination and workflow errors
  - Cache manager: track cache operations and persistence errors
  - Search service: track search and indexing errors
  - Manager: track initialization and lifecycle errors
  - Service factory: track service creation errors

This improves observability and debugging capabilities for the code indexing system.
@daniel-lxs daniel-lxs force-pushed the feat/add-code-index-error-telemetry branch from 51de1b0 to c850f89 Compare July 11, 2025 14:42
- Mock TelemetryService.instance in all code-index test files to prevent initialization errors
- Adjust expectation in openai.spec.ts for error with failing toString method to match Vitest behavior
- All 325 code-index tests now pass successfully
@daniel-lxs daniel-lxs marked this pull request as ready for review July 11, 2025 16:45
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 11, 2025
- Replace individual error telemetry events with aggregated reporting
- Collect errors during batch processing and send single consolidated event
- Include error count, type breakdown, and sanitized examples
- Add comprehensive tests for error aggregation behavior
- Remove complex error aggregation logic
- Remove _createErrorSummary method
- Report only batch-level errors to telemetry, not individual file errors
- Maintain error sanitization using sanitizeErrorMessage
- Simplify method signatures by removing aggregatedErrors parameters
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 12, 2025
@mrubens mrubens merged commit 32308d7 into main Jul 12, 2025
10 of 11 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jul 12, 2025
@mrubens mrubens deleted the feat/add-code-index-error-telemetry branch July 12, 2025 03:01
chrarnoldus added a commit to Kilo-Org/kilocode that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants