feat: add prominent startup warning for DEV mode

Add comprehensive warning display when server starts in development mode
to ensure users are aware of simulated AI calls and data handling.

Changes:
- Add log_dev_mode_startup_warning() function in deployment_config.py
- Display warning on main.py startup when DEPLOYMENT_MODE=DEV
- Display warning on API server startup (api/main.py)
- Warning shows AI simulation status and data persistence behavior
- Provides clear instructions for switching to PROD mode

The warning is highly visible and informs users that:
- AI API calls are simulated (no costs incurred)
- Data may be reset between runs (based on PRESERVE_DEV_DATA)
- System is using isolated dev database and paths

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-01 12:57:54 -04:00
parent d656dac1d0
commit b9353e34e5
3 changed files with 45 additions and 6 deletions

View File

@@ -119,6 +119,43 @@ def log_api_key_warning() -> None:
print(" This is expected if you're testing dev mode with existing .env file")
def log_dev_mode_startup_warning() -> None:
"""
Display prominent warning when server starts in DEV mode
Warns users that:
- AI calls will be simulated/mocked
- Data may not be retained between runs
- This is a development environment
"""
if not is_dev_mode():
return
preserve_data = should_preserve_dev_data()
print()
print("=" * 70)
print("⚠️ " + "DEVELOPMENT MODE WARNING".center(64) + " ⚠️")
print("=" * 70)
print()
print(" 🚧 This server is running in DEVELOPMENT mode (DEPLOYMENT_MODE=DEV)")
print()
print(" 📌 IMPORTANT:")
print(" • AI API calls will be SIMULATED (mock responses)")
print(" • No real AI model costs will be incurred")
if preserve_data:
print(" • Dev data WILL BE PRESERVED between runs (PRESERVE_DEV_DATA=true)")
else:
print(" • Dev data WILL BE RESET on each startup (PRESERVE_DEV_DATA=false)")
print(" • Using isolated dev database and data paths")
print()
print(" 💡 To use PRODUCTION mode:")
print(" Set environment variable: DEPLOYMENT_MODE=PROD")
print()
print("=" * 70)
print()
def get_deployment_mode_dict() -> dict:
"""
Get deployment mode information as dictionary (for API responses)