refactor: Modernize environment management and backend architecture#3
Merged
refactor: Modernize environment management and backend architecture#3
Conversation
Environment & Configuration: - Unified env management with .env.example template and consolidated .gitignore - Added dev-local.sh, dev-hybrid.sh, dev-backend.sh for clear dev workflows - Updated package.json scripts and removed obsolete shell scripts Frontend Improvements: - Enhanced API URL detection for seamless local/prod switching - Improved error handling and fallback configuration Backend Architecture Refactor: - Refactored agents.py with DRY principles and best practices - Added ProductionDetector, LLMClientFactory, JSONResponseParser classes - Eliminated code duplication in agent initialization - Fixed all lint errors: removed unused imports/variables, unnecessary f-strings - Enhanced type hints and comprehensive docstrings - Centralized LLM client creation with environment-aware Helicone integration Production Requirements: - Helicone monitoring REQUIRED in production, optional in development - Robust environment detection via VERCEL/NODE_ENV/ENVIRONMENT variables All changes tested and verified working across local/hybrid/production modes.
- Added detailed logging throughout agents.py initialization - Added environment detection and API key status logging - Added error handling with detailed error messages in main.py - Added try/catch blocks around GameOrchestrator creation - Logs show exactly when/where agent initialization fails - Will help identify root cause of Vercel 500 errors
47b610e to
5a38987
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Environment & Configuration:
Frontend Improvements:
Backend Architecture Refactor:
Production Requirements:
All changes tested and verified working across local/hybrid/production modes.