Run screen
PhaseRow
Bases: Static
flowchart TD
src.tradingagents.interface.tui.run_screen.PhaseRow[PhaseRow]
click src.tradingagents.interface.tui.run_screen.PhaseRow href "" "src.tradingagents.interface.tui.run_screen.PhaseRow"
One row in the phase sidebar.
Rendered as a compact icon | label | progress line whose CSS
class encodes the current status (-pending / -running /
-done) so :file:styles.tcss can colour them appropriately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Phase
|
Initial phase data; the widget id is taken
from |
required |
Methods:
| Name | Description |
|---|---|
render |
Compose the row content as a Rich Text line. |
update_phase |
Replace the row's contents and CSS class with |
Source code in src/tradingagents/interface/tui/run_screen.py
render
Compose the row content as a Rich Text line.
Returns:
| Name | Type | Description |
|---|---|---|
Text |
Text
|
An icon, the phase label, and an optional progress |
Text
|
counter, separated by a space. |
Source code in src/tradingagents/interface/tui/run_screen.py
update_phase
Replace the row's contents and CSS class with phase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Phase
|
The new phase data; only fields whose values differ from the previous render trigger a refresh. |
required |
Source code in src/tradingagents/interface/tui/run_screen.py
RunScreen
Bases: Screen[None]
flowchart TD
src.tradingagents.interface.tui.run_screen.RunScreen[RunScreen]
click src.tradingagents.interface.tui.run_screen.RunScreen href "" "src.tradingagents.interface.tui.run_screen.RunScreen"
Drive a single :meth:TradingAgentsGraph.propagate run.
The screen composes the static layout up-front, then kicks off a
worker thread on mount. The worker streams panel renderables back
via :meth:App.call_from_thread, which is the only thread-safe way
to mutate Textual widgets from outside the event loop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
SetupParams
|
The validated parameter bundle from
:class: |
required |
Methods:
| Name | Description |
|---|---|
compose |
Build the screen layout. |
on_mount |
Cache widget references and kick off the pipeline worker. |
action_quit_screen |
Exit the app, returning the final decision (or None) to |
run_pipeline |
Run :meth: |
Source code in src/tradingagents/interface/tui/run_screen.py
BINDINGS
BINDINGS: list[Binding] = [
Binding("q", "quit_screen", "Quit"),
Binding("ctrl+c", "quit_screen", "Quit"),
]
compose
Build the screen layout.
Yields:
| Name | Type | Description |
|---|---|---|
ComposeResult |
ComposeResult
|
Header panel, sidebar with one |
ComposeResult
|
class: |
|
ComposeResult
|
class: |
Source code in src/tradingagents/interface/tui/run_screen.py
on_mount
Cache widget references and kick off the pipeline worker.
action_quit_screen
run_pipeline
Run :meth:TradingAgentsGraph.propagate on a worker thread.
Constructs a :class:MessageRenderer whose emit defers each
Rich renderable to the Textual event loop, and an on_state
hook that recomputes the sidebar phase list from the latest
:class:AgentState snapshot. All UI mutations are routed
through :meth:App.call_from_thread via :meth:_safe_call so
the worker unwinds quietly when the user quits mid-run; a
broken hook can never abort a paid LLM call once it has
started.