Features:
- Add analysis_mode parameter (fast/deep) to AnalysisRequest
- Fast mode (15-25 min): Disables investment and risk debates (max_debate_rounds=0)
- Deep mode (60 min): Default mode with debates enabled
- Update backend TradingService to handle analysis_mode
- Add analysis_mode form field to frontend with dropdown selector
- Update TypeScript interfaces to include analysis_mode
Changes:
- backend/app/models/schemas.py: Add analysis_mode field to AnalysisRequest
- backend/app/services/trading_service.py: Handle analysis_mode in create_config()
- backend/app/api/routes.py: Pass analysis_mode parameter to run_analysis()
- frontend/components/analysis/AnalysisForm.tsx: Add analysis_mode dropdown (fast/deep)
- frontend/lib/types.ts: Add analysis_mode to AnalysisRequest interface
When users select "fast mode", the system will:
1. Skip investment debate (max_debate_rounds = 0)
2. Skip risk debate (max_risk_discuss_rounds = 0)
3. Reduce analysis time from ~60 minutes to ~15-25 minutes
4. Still run all analyst reports with proper 500-1000 word counts
5. Provide initial decision without debate refinement
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Changes:
- C1: Increase Redis TTL from 1 hour to 4 hours for completed tasks (prevents report deletion)
- Word count: Change all analyst prompts from 800-1500 to 500-1000 words
- Output filter: Update word count validation to 500-1000 range, hide specific word counts in warnings
- Remove character counts from output to improve clarity
These changes address:
1. Reports being deleted after 1 hour (now 4 hours)
2. Inconsistent word counts causing reruns (now strict 500-1000)
3. Output showing specific word counts (now just pass/warning)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Pass max_debate_rounds and max_risk_discuss_rounds from config to ConditionalLogic
- Pass max_recur_limit from config to Propagator
- Increase default recursion_limit from 100 to 200 in default_config.py
- Increase Propagator default max_recur_limit from 100 to 200
Also includes earlier fixes:
- Add 365-day minimum date range validation to get_stock_data tool
- Update market analyst prompt to specify 1-year data requirement
- Initialize all debate state fields (bull_history, bear_history, judge_decision, etc.)
- Add report completeness logging in trading_service.py
- Add debug logging in frontend results page
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1. Auto-save reports when page closes:
- Added beforeunload handler to auto-save analysis to history
- Saves to local IndexedDB and cloud (if authenticated)
- Prevents data loss if user accidentally closes the page
2. Fix PDF download from history page:
- Made taskId optional in DownloadReports component
- Added direct mode: can pass reports data directly
- Updated backend to support both task-based and direct-data modes
- History reports now have download PDF option available
- Add matplotlib for chart generation
- Implement _calculate_heikin_ashi() for HA OHLC calculation
- Implement _generate_price_chart() to create candlestick + volume charts
- Charts are generated as PNG images and embedded in PDF
- Fallback to text summary if chart generation fails
- First page now shows visual charts like the web interface
- Page 1 now shows price statistics (growth rate, duration, start/end prices)
- Page 1 also includes last 5 trading days data
- Page 2+ contains the original analyst insights
- Updates pdf_generator.py, download_service.py, and routes.py