Commit Graph

18 Commits

Author SHA1 Message Date
robinsxe ccf375eafd
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-26 18:20:23 +01:00
robinsxe 2648f91e09
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 22:52:57 +01:00
robinsxe 59a2212ff7
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 22:44:24 +01:00
Robin Lindbladh 5d09c4c984 fix: gate tracebacks behind debug flag to prevent info leakage
Only include full tracebacks in error messages when debug=True.
In non-debug mode, return clean error messages without internal
implementation details.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:16:03 +01:00
robinsxe 6f5610d82b
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 21:14:42 +01:00
Robin Lindbladh 2ce7e2b6d0 fix: broaden _log_portfolio exception catch to handle all failures
OSError only covers file I/O errors; json.dump can also raise
TypeError on non-serializable data. Use Exception to ensure logging
failures never discard analysis results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:11:49 +01:00
Robin Lindbladh 3abff48c7d fix: protect log file write and preserve log_states_dict
- Wrap _log_portfolio file I/O in try/except so a write failure
  doesn't discard the analysis results
- Preserve and restore self.log_states_dict in propagate_portfolio()
  alongside ticker and curr_state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:10:33 +01:00
Robin Lindbladh 5ac72567be fix: add config parameter to PortfolioAnalyzer constructor
Required by the configurable log directory and config passthrough
from TradingAgentsGraph that were applied via GitHub suggestions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:08:14 +01:00
robinsxe 698b4ede4a
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 21:06:45 +01:00
robinsxe 92b527b60a
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 21:01:35 +01:00
robinsxe 0c4a912b0a
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 21:01:25 +01:00
Robin Lindbladh b3a087286b fix: remove redundant inline traceback import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:58:18 +01:00
robinsxe 95e10bd1fd
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 20:32:32 +01:00
robinsxe 2466ec3c90
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 20:32:09 +01:00
Robin Lindbladh 85fbc48ede fix: address code review feedback
- Preserve and restore self.ticker and self.curr_state in
  propagate_portfolio() using try/finally to prevent side effects
- Use pathlib.Path for log file construction in _log_portfolio()
- Move traceback import to module level

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:20:46 +01:00
robinsxe dbd2c658e5
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 20:18:30 +01:00
robinsxe 03d7752d46
Update tradingagents/graph/portfolio_analysis.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-24 20:18:14 +01:00
Robin Lindbladh ae2c813d8a feat: add portfolio analysis for multi-stock comparison
Add PortfolioAnalyzer class that runs the full agent pipeline on multiple
stocks and produces a comparative KEEP/REDUCE/EXIT recommendation using
the deep thinking LLM. Includes per-ticker error handling, graceful
degradation on LLM failure, and result logging.

Addresses #60 and partially #406.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:10:21 +01:00