Skip to content

Conversation

@robglnn
Copy link

@robglnn robglnn commented Nov 27, 2025

This PR adds a RAG-powered error message assistant as a new package in the React monorepo. The assistant intercepts Vite compilation errors during development and provides contextual solutions using a local knowledge base and configurable LLM providers.

Features:

  • Real-time error interception and analysis via Vite plugin
  • RAG-powered solution generation using local knowledge base
  • Support for multiple LLM providers (Ollama, OpenAI, Grok)
  • Graceful degradation when Python/knowledge base unavailable
  • Comprehensive test coverage (42 tests, all passing)
  • Follows React's patterns for production/test differences

The package is located at packages/react-error-assistant/ and includes:

  • TypeScript/Node.js Vite plugin and error parsing
  • Python RAG pipeline with ChromaDB vector store
  • Knowledge base builder for React/Vite documentation
  • E2E test fixtures and comprehensive test suite

All tests pass in both dev and production modes. Component extraction gracefully degrades in production Jest environments following React's standards.

Summary

This PR adds a RAG-powered error message assistant as a new package (packages/react-error-assistant/) in the React monorepo. The assistant intercepts Vite compilation errors during development and provides contextual solutions using a local knowledge base and configurable LLM providers.

**Motivation:
React/Vite developers often face cryptic error messages that lack context, requiring external searches (Stack Overflow, GitHub, docs) that take 10-15 minutes per error on average. This assistant provides:

  • Real-time contextual solutions directly in the terminal
  • Privacy-first approach with local LLM support (Ollama)
  • Offline capability for development without internet
  • Multiple LLM providers (Ollama, OpenAI, Grok) for flexibility

**What it solves:

  • Reduces debugging time from 10-15 minutes to seconds
  • Provides context-aware solutions based on React/Vite documentation
  • Works offline with local LLM (Ollama)
  • Gracefully degrades when Python/knowledge base unavailable (error parsing still works)
  • No breaking changes - new package with zero impact on existing React packages

How did you test this change?

  1. TypeScript Tests (42 tests, all passing):

    yarn test packages/react-error-assistant
    • Error parser tests - All error types (MODULE_NOT_FOUND, SYNTAX_ERROR, TYPE_ERROR, etc.)
    • Context extractor tests - Context building and query construction
    • Python bridge tests - Bridge lifecycle and error handling
    • Vite plugin tests - Plugin hooks and configuration
    • E2E error scenarios - Top 20 common React/Vite errors
    • Performance tests - Latency benchmarks
  2. Production Tests (42 tests, all passing):

    yarn test --prod packages/react-error-assistant
    • All tests pass in production Jest mode
    • Component extraction gracefully degrades (follows React's patterns)
  3. Type Checking:

    cd packages/react-error-assistant && yarn typecheck
    • No TypeScript errors
  4. Linting:

    cd packages/react-error-assistant && yarn lint
    • No ESLint errors
  5. Code Formatting:

    yarn prettier --check packages/react-error-assistant
    • All code properly formatted
  6. Manual Testing:

    • Tested with Vite dev server - errors intercepted correctly
    • Tested with various error types (import errors, syntax errors, type errors)
    • Verified graceful degradation when Python unavailable
    • Tested RAG pipeline with Ollama (local LLM)
    • Verified solution generation and display

Test Coverage:

  • Error parsing: >90% coverage (all error types, edge cases)
  • Core components: >80% coverage
  • Integration: End-to-end tests included
  • Performance: Latency benchmarks included

Screenshots:
2025-11-26 18_38_09-Administrator_ Windows PowerShell
2025-11-26 18_38_27-Administrator_ Windows PowerShell

This PR adds a RAG-powered error message assistant as a new package in the React monorepo. The assistant intercepts Vite compilation errors during development and provides contextual solutions using a local knowledge base and configurable LLM providers.

Features:
- Real-time error interception and analysis via Vite plugin
- RAG-powered solution generation using local knowledge base
- Support for multiple LLM providers (Ollama, OpenAI, Grok)
- Graceful degradation when Python/knowledge base unavailable
- Comprehensive test coverage (42 tests, all passing)
- Follows React's patterns for production/test differences

The package is located at packages/react-error-assistant/ and includes:
- TypeScript/Node.js Vite plugin and error parsing
- Python RAG pipeline with ChromaDB vector store
- Knowledge base builder for React/Vite documentation
- E2E test fixtures and comprehensive test suite

All tests pass in both dev and production modes. Component extraction gracefully degrades in production Jest environments following React's standards.
@meta-cla meta-cla bot added the CLA Signed label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant