Commit Graph

339 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 69a2d72e60 Add tests for LangGraphEngine run modes (run_scan, run_pipeline, run_portfolio, run_auto)
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/ba209f7b-e985-42bb-bdce-95e73bc67bfc
2026-03-23 20:06:27 +00:00
copilot-swe-agent[bot] 73e5527afa Initial plan 2026-03-23 19:56:18 +00:00
ahmet guzererler 36a6b17a22
Merge pull request #92 from aguzererler/copilot/fix-report-saving-in-runs
Fix report persistence, run status tracking, auto-mode stock sourcing, and portfolio context loading
2026-03-23 19:55:42 +01:00
copilot-swe-agent[bot] 9187a69ce2 Fix report saving, event storing, auto tickers, portfolio report loading, and state propagation
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/9fff2f5e-b384-4b0a-8e23-ede31af12fe2
2026-03-23 18:33:11 +00:00
copilot-swe-agent[bot] 6b1bc27dac Initial plan 2026-03-23 18:08:57 +00:00
ahmet guzererler 41681e0f9e
Merge pull request #91 from aguzererler/fix-analyst-tool-loop-18174774985345323969
fix: use run_tool_loop instead of invoke in analyst agents
2026-03-23 18:36:33 +01:00
google-labs-jules[bot] 3721aab110 test: add unit tests for analyst agents tool looping
Added comprehensive unit tests for `fundamentals_analyst`, `market_analyst`,
`social_media_analyst`, and `news_analyst` to verify that they correctly
handle recursive tool calling via `run_tool_loop`. A MockLLM was created
to simulate a two-turn conversation (tool call request followed by a final
report generation) to ensure the `.invoke()` bug does not regress. Added
missing `build_instrument_context` imports to those agents to prevent
NameErrors.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-23 17:22:28 +00:00
google-labs-jules[bot] 9cf3a023fa fix: use run_tool_loop instead of invoke in analyst agents
This commit updates the `fundamentals_analyst`, `market_analyst`,
`social_media_analyst`, and `news_analyst` files to use `run_tool_loop`
instead of `.invoke()`. Using `.invoke()` resulted in the LLM execution
stopping immediately upon a tool call request without executing the tool,
returning an empty report or raw JSON. The `run_tool_loop` function
ensures tools are executed recursively and the final text content is
returned.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-23 17:00:35 +00:00
ahmet guzererler 5bdd42f818
Merge pull request #90 from aguzererler/copilot/check-upstream-changes
docs: upstream PR triage and evaluation (2026-03-23)
2026-03-23 17:48:24 +01:00
copilot-swe-agent[bot] 4c186a55e8 merge: sync with upstream TauricResearch/TradingAgents v0.2.2
Merges upstream/main into our fork, bringing in:
- Security: Remove chainlit (CVE-2026-22218), patch LangGrinch vulnerability
- Bug fixes: debate state init, UTF-8 encoding, stock data parsing, debate round config
- Features: OpenAI Responses API, five-tier rating scale, Anthropic effort support,
  exchange-qualified tickers, yfinance retry with exponential backoff
- Refactor: risk_manager renamed to portfolio_manager

Conflicts resolved preserving our fork's:
- Per-tier LLM config (quick/mid/deep think with provider overrides)
- Separate tool files (fundamental_data_tools, core_stock_tools, etc.)
- Custom tools (get_ttm_analysis, get_peer_comparison, get_sector_relative, get_macro_regime)
- Dynamic Ollama model fetching
- Enhanced fundamentals analyst prompt with TTM analysis
- Hardened stockstats/yfinance data pipeline (_load_or_fetch_ohlcv)
- AgentOS observability layer, scanner pipeline, portfolio management

Tests: 727 passed, 14 skipped
2026-03-23 12:17:25 +00:00
copilot-swe-agent[bot] f3025a9768 docs: add upstream PR review with evaluations and recommendations (2026-03-23)
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/140fed95-3b4f-4d92-a410-ca550f93866a
2026-03-23 11:53:53 +00:00
copilot-swe-agent[bot] f990153866 Initial plan 2026-03-23 11:48:46 +00:00
ahmet guzererler 6ae6eb6435
Merge pull request #31 from aguzererler/copilot/create-information-flow-models
docs: add agent data flow documentation with context window budget
2026-03-23 12:06:03 +01:00
ahmet guzererler 075b52453c
Merge pull request #87 from aguzererler/feat/agent-os-observability
feat: AgentOS - Visual Observability & Command Center
2026-03-23 12:00:46 +01:00
ahmet guzererler d5f1c8fa22
Merge pull request #89 from aguzererler/copilot/add-prompts-to-backend-frontend
Fix AgentOS node persistence, add event content streaming, update packages
2026-03-23 11:53:09 +01:00
copilot-swe-agent[bot] e808031aa6 docs: update docs/agent/ with AgentOS architecture, components, conventions, and ADR 013
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/7cf1fa1a-8cb0-46b4-bc20-525aa3d38d7d
2026-03-23 10:48:49 +00:00
copilot-swe-agent[bot] 1b5aee572a fix: portfolio field mapping (shares→quantity, cash→cash_balance) and pipeline recursion limit
- Map backend Holding.shares → frontend quantity, include market_value/unrealized_pnl
- Map backend Portfolio.portfolio_id → id, cash → cash_balance
- Map backend Trade.shares → quantity, trade_date → executed_at
- Pass recursion_limit=100 to pipeline astream_events() to prevent GraphRecursionError

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/b189c934-24b9-49a9-99d9-99ee006da4b0
2026-03-23 09:40:56 +00:00
copilot-swe-agent[bot] a77e3f1264 fix: make _map_langgraph_event crash-proof with try/except and _safe_dict
- Wrap each event-type branch (LLM start/end, tool start/end) in try/except
  to prevent a single unexpected object shape from crashing the streaming loop
- Add _safe_dict() helper to guard response_metadata and usage_metadata
  access — some providers return non-dict types (bound methods, etc.)
- Fix potential_text extraction: check for None AND callable before using
- Ensure all event IDs use .get() with fallback to prevent KeyError
- Fix test file: remove hardcoded /Users/Ahmet/ path, add edge-case tests
  for non-dict metadata, tool events, and unknown event types
- All 725 unit tests pass, TypeScript compiles clean

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/fe6575b5-c03b-4037-bd98-a94303ae8313
2026-03-23 09:17:19 +00:00
Ahmet Guzererler 319168c74f feat: Resolve "main_portfolio" alias in portfolio routes and improve LangGraph content extraction robustness with new unit tests. 2026-03-23 10:02:52 +01:00
copilot-swe-agent[bot] 6999da0827 feat: button states, full prompt extraction, portfolio viewer, param inputs
1. Run buttons: only the triggered button shows spinner, others disabled
2. Backend: enhanced prompt extraction with multiple fallback paths
   (data.messages, data.input.messages, data.input, data.kwargs.messages)
   and raw dump fallback; improved response extraction for edge cases
3. Portfolio viewer: new PortfolioViewer component with holdings table,
   trade history, and summary tabs; portfolio dropdown with auto-load;
   Wallet sidebar icon now navigates to portfolio page
4. Parameter inputs: collapsible panel with date/ticker/portfolio_id;
   validation prevents running without required fields per run type

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/ffa268c8-e97c-4335-9bce-19bba583bea9
2026-03-23 08:46:34 +00:00
copilot-swe-agent[bot] b08ce7199e feat: fix prompt display, add event detail modal, run buttons, and node animations
Backend:
- Extract full prompt from all LLM messages (not just first)
- Add prompt/response fields to streamed event payloads
- Improve model name extraction with multiple fallback strategies
- Add run_portfolio and run_auto streaming methods
- Wire portfolio/auto in websocket router
- New tool_result event type for tool completion

Frontend:
- Add full event detail modal with tabs (Prompt, Response, Summary, Metrics)
- Show actual prompt content in drawer instead of "Prompting unknown..."
- Add Scan, Pipeline, Portfolio, Auto buttons to control panel
- Fix node animation: completed nodes never revert to running
- Handle tool_result type for marking tool nodes as done
- Drawer events have "Full Detail →" button to open modal

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/7997c579-ab7e-4071-afd0-18703a8e5618
2026-03-23 08:04:53 +00:00
copilot-swe-agent[bot] 9d2dbf4a43 fix: add missing __init__.py files to agent_os package tree
The agent_os/, agent_os/backend/, agent_os/backend/routes/, and
agent_os/backend/services/ directories were missing __init__.py,
causing `from agent_os.backend.routes import ...` to fail with
ModuleNotFoundError when running `python agent_os/backend/main.py`.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/4b002166-5cc2-4a75-aa01-14d7b5d8d8bc
2026-03-23 07:16:38 +00:00
copilot-swe-agent[bot] cf2df83c38 feat: clickable terminal events, node inspector drawer, stop animation on complete, vite 8
1. Terminal: remove inline prompts/full text; show short summary per event;
   click any event to open detail drawer with full request/response/model/metrics
2. Fix node "thinking" animation: shimmer only when status=running;
   on_chat_model_end (result) transitions node to completed, animation stops
3. Link nodes to events: clicking a graph node opens the drawer showing
   all events for that node (prompts, tool calls, results)
4. Upgrade Vite 5→8.0.1, @vitejs/plugin-react→5.2.0;
   update tsconfig moduleResolution to "bundler" for Vite 8 compat

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/93c31c35-9509-4254-96fd-6f47aad07927
2026-03-23 07:03:48 +00:00
copilot-swe-agent[bot] 06e913f1ba fix: bump axios to ^1.13.5 to address known vulnerabilities (SSRF, DoS)
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/5c511c4e-5172-4eda-b6de-aefa1859e8ac
2026-03-23 00:55:46 +00:00
copilot-swe-agent[bot] 7726483034 refactor: address code review - extract helpers for content extraction and message parsing
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/5c511c4e-5172-4eda-b6de-aefa1859e8ac
2026-03-23 00:53:25 +00:00
copilot-swe-agent[bot] e9be24600f fix: AgentOS backend logging/prompts, frontend node persistence, package updates
Backend:
- Replace bare print() with structured logging module
- Include LLM prompt snippets and response content in streamed events
- Extract proper node names from LangGraph metadata (langgraph_node)
- Add latency tracking (start/end time per node)
- Add tool input/output content in events
- Add system log event type for informational messages
- Stream on_tool_end events for tool results

Frontend:
- Fix node disappearing/reappearing: use useNodesState/useEdgesState + useEffect
  for incremental updates instead of useMemo that rebuilt all nodes on each event
- Fix duplicate node creation: use useRef to track seen node IDs persistently
- Fix useAgentStream reconnection loop: remove stale `status` from connect deps
- Use statusRef to avoid stale closure in onclose handler
- Add auto-scroll to terminal, event count, type labels/colors
- Show prompt snippets, tool I/O, and response content in terminal
- Handle 'log' event type

Packages:
- Update all npm deps to latest compatible minor versions
- Remove node_modules from git tracking, add to .gitignore

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/5c511c4e-5172-4eda-b6de-aefa1859e8ac
2026-03-23 00:51:29 +00:00
copilot-swe-agent[bot] 362d148a26 Initial plan 2026-03-23 00:39:42 +00:00
Yijia-Xiao 589b351f2a
TradingAgents v0.2.2 2026-03-22 23:47:56 +00:00
Yijia-Xiao 6c9c9ce1fd
fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
Yijia-Xiao b8b2825783 refactor: standardize portfolio manager, five-tier rating scale, fix analyst status tracking 2026-03-22 23:30:29 +00:00
Yijia-Xiao 318adda0c6 refactor: five-tier rating scale and streamlined agent prompts 2026-03-22 23:07:20 +00:00
Yijia Xiao c3ba3bf428
Merge pull request #413 from CadeYu/codex/exchange-qualified-tickers
fix: preserve exchange-qualified tickers across agent prompts
2026-03-22 15:36:14 -07:00
Yijia-Xiao 7cca9c924e fix: add exponential backoff retry for yfinance rate limits (#426) 2026-03-22 22:11:08 +00:00
Yijia-Xiao bd9b1e5efa feat: add Anthropic effort level support for Claude models
Add effort parameter (high/medium/low) for Claude 4.5+ and 4.6 models,
consistent with OpenAI reasoning_effort and Google thinking_level.
Also add content normalization for Anthropic responses.
2026-03-22 21:57:05 +00:00
Ahmet Guzererler 86e414f8f1 feat: Implement `init-portfolio` CLI command and add WebSocket streaming support. 2026-03-22 22:55:48 +01:00
Ahmet Guzererler a9c565ec36 docs: finalize AgentOS documentation
- add root agent_os/README.md with system architecture and setup guides
- update DESIGN.md with port 8088 migration and network configurations
- document real-time DAG rendering and high-fidelity risk metrics
2026-03-22 22:54:20 +01:00
Ahmet Guzererler 2116c14d07 fix: prevent multiple run triggers from button clicks
- add isTriggering state to Dashboard
- disable button immediately upon click
- update isLoading prop to include trigger state
2026-03-22 22:51:35 +01:00
Ahmet Guzererler 7dd7a5c0b6 fix: migrate backend to port 8088 and use 127.0.0.1 to avoid macOS system conflicts
- move backend port from 8001 to 8088
- update frontend to use 127.0.0.1 explicitly instead of localhost
- add request/response logging middleware to backend
- fix explicit CORS origin matching for browser compatibility
2026-03-22 22:51:09 +01:00
Ahmet Guzererler c9e5e8989f fix: align report paths and improve node name mapping for live streaming
- update portfolio summary route to check 'summary/' directory for scan results
- enhance LangGraph event mapping to extract functional node names from metadata
- fix initial state keys for ScannerGraph to match TradingAgents internals
2026-03-22 22:46:21 +01:00
Yijia-Xiao 77755f0431 chore: consolidate install, fix CLI portability, normalize LLM responses
- Point requirements.txt to pyproject.toml as single source of truth
- Resolve welcome.txt path relative to module for CLI portability
- Include cli/static files in package build
- Extract shared normalize_content for OpenAI Responses API and
  Gemini 3 list-format responses into base_client.py
- Update README install and CLI usage instructions
2026-03-22 21:38:01 +00:00
Ahmet Guzererler d5df6b93a4 feat: connect Top 3 Metrics to real data from Supabase and macro scans
- add /api/portfolios/{id}/summary endpoint to backend
- parse Sharpe and Drawdown from latest portfolio snapshots
- parse Market Regime from macro_scan/scan_summary.json
- update MetricHeader to fetch real-time metrics with polling
- pass portfolio_id to dashboard and trigger methods
2026-03-22 22:14:27 +01:00
Ahmet Guzererler 078d7e2f2a feat: implement AgentOS frontend and live backend integration
- scaffold Vite + React + TypeScript frontend with Chakra UI and React Flow
- implement AgentGraph, MetricHeader, and Dashboard components
- connect FastAPI to live LangGraph events via astream_events
- implement real-time event mapping for 'scan' and 'pipeline'
- refactor run storage for shared access between REST and WebSockets
2026-03-22 22:12:33 +01:00
Ahmet Guzererler a26c93463a feat: initialize AgentOS observability foundation
- implement FastAPI backend with REST and WebSocket streaming
- add node-level metrics (tokens, latency) to event protocol
- design literal graph and top 3 metrics (Sharpe, Regime, Drawdown)
- scaffold React frontend with Chakra UI and useAgentStream hook
- add DESIGN.md and .env.example
2026-03-22 21:54:13 +01:00
Yijia-Xiao 0b13145dc0 fix: handle list content when writing report sections
Closes #400
2026-03-22 20:40:18 +00:00
Yijia-Xiao 3ff28f3559 fix: use OpenAI Responses API for native models
Enable use_responses_api for native OpenAI provider, which supports
reasoning_effort with function tools across all model families.
Removes the UnifiedChatOpenAI subclass workaround.

Closes #403
2026-03-22 20:34:03 +00:00
ahmet guzererler b2fe6ec8c3
Merge pull request #86 from aguzererler/copilot/review-comments
fix: four follow-up issues from PR #85 dataflows hardening
2026-03-22 10:05:09 +01:00
copilot-swe-agent[bot] 48004c654d Merge remote-tracking branch 'origin/main' into copilot/review-comments
# Conflicts:
#	cli/main.py
#	tests/cli/test_stats_handler.py
#	tradingagents/pipeline/macro_bridge.py
2026-03-22 07:44:49 +00:00
copilot-swe-agent[bot] 0e3edcdf5a fix: update test_stats_handler.py for langchain_core >=1.0 compatibility
In langchain_core >=1.0 plain Generation no longer stores a .message
attribute - that only exists on ChatGeneration. Tests were constructing
Generation(message=AIMessage(...)) which silently dropped the message,
making hasattr(generation, "message") return False and skipping the
token-counting path (all usage assertions failed with 0).

- Replace Generation(message=...) with ChatGeneration(message=AIMessage(...))
  in test_stats_handler_on_llm_end_with_usage and thread_safety test
- Use UsageMetadata(input_tokens=N, output_tokens=N, total_tokens=N)
  instead of bare dict (total_tokens is required in langchain_core 1.2+)
- Pass usage_metadata via AIMessage constructor instead of post-init
  attribute assignment (avoids pydantic validation bypass)
- Keep Generation(text=...) in test_stats_handler_on_llm_end_no_usage
  (correctly tests the "no usage" branch — plain Generation has no .message)

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/ce079791-08ef-4f2e-9f31-a1ae6a26b4cb
2026-03-22 06:58:38 +00:00
copilot-swe-agent[bot] a8b909e2ca merge: resolve conflicts with origin/main (PR #85 merged)
- cli/main.py: keep module-level rich.progress imports + result.elapsed_seconds
  (our review fixes); take main's extract_content_string (no ast.literal_eval)
- y_finance.py: take main's vectorized _get_stock_stats_bulk (better perf);
  keep our logger.warning() fix in the fallback path
- macro_bridge.py: keep our elapsed_seconds assignments (2 paths)

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/6e4151b2-17e3-473b-bf24-872a2656cd3f
2026-03-22 06:52:39 +00:00
ahmet guzererler cef65d922d
Merge pull request #85 from aguzererler/fix/dataflows-incident-hardened-error-handling
fix: harden dataflows layer against silent failures and data corruption
2026-03-22 07:43:33 +01:00