TradingAgents/agent_os
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
..
backend fix: make _map_langgraph_event crash-proof with try/except and _safe_dict 2026-03-23 09:17:19 +00:00
frontend feat: button states, full prompt extraction, portfolio viewer, param inputs 2026-03-23 08:46:34 +00:00
DESIGN.md docs: finalize AgentOS documentation 2026-03-22 22:54:20 +01:00
README.md docs: finalize AgentOS documentation 2026-03-22 22:54:20 +01:00
__init__.py fix: add missing __init__.py files to agent_os package tree 2026-03-23 07:16:38 +00:00

README.md

AgentOS: Visual Observability & Command Center

AgentOS is a real-time observability and command center for the TradingAgents framework. It provides a visual interface to monitor multi-agent workflows, analyze portfolio risk metrics, and trigger automated trading pipelines.

System Architecture

  • Backend: FastAPI (Python)
    • Orchestrates LangGraph executions.
    • Streams real-time events via WebSockets.
    • Serves portfolio data from Supabase.
    • Port: 8088 (default)
  • Frontend: React (TypeScript) + Vite
    • Visualizes agent workflows using React Flow.
    • Displays high-fidelity risk metrics (Sharpe, Regime, Drawdown).
    • Provides a live terminal for deep tracing.
    • Port: 5173 (default)

Getting Started

1. Prerequisites

  • Python 3.10+
  • Node.js 18+
  • uv (recommended for Python environment management)

2. Backend Setup

# From the project root
export PYTHONPATH=$PYTHONPATH:.
uv run python agent_os/backend/main.py

The backend will start on http://127.0.0.1:8088.

3. Frontend Setup

cd agent_os/frontend
npm install
npm run dev

The frontend will start on http://localhost:5173.

Key Features

  • Literal Graph Visualization: Real-time DAG rendering of agent interactions.
  • Top 3 Metrics: High-level summary of Sharpe Ratio, Market Regime, and Risk/Drawdown.
  • Live Terminal: Color-coded logs with token usage and latency metrics.
  • Run Controls: Trigger Market Scans, Analysis Pipelines, and Portfolio Rebalancing directly from the UI.

Port Configuration

AgentOS uses port 8088 for the backend to avoid conflicts with common macOS services. The frontend is configured to communicate with 127.0.0.1:8088.