Skip to content

feat: write run_config.md alongside each analysis (#752)#790

Open
djconnexion77 wants to merge 4 commits into
TauricResearch:mainfrom
djconnexion77:feat/run-config-report-752
Open

feat: write run_config.md alongside each analysis (#752)#790
djconnexion77 wants to merge 4 commits into
TauricResearch:mainfrom
djconnexion77:feat/run-config-report-752

Conversation

@djconnexion77
Copy link
Copy Markdown

Closes #752.

Each saved analysis now includes a run_config.md at the report root, capturing:

  • tradingagents package version (exposed via importlib.metadata)
  • Ticker, analysis date, selected analysts, research depth, output language
  • LLM provider, quick-thinking model, deep-thinking model, backend URL
  • Max debate rounds, max risk discuss rounds, checkpoint flag
  • Provider-specific reasoning params (OpenAI reasoning effort, Google thinking level, Anthropic effort) — only rendered when set

Why

Issue #752 describes comparing runs across LLM families (OpenAI vs Google vs Ollama) and over time as models and tradingagents itself evolve. Without persisted config, you can't tell from disk which parameters produced which report.

Implementation

  • New tradingagents.__version__ via importlib.metadata.version("tradingagents")
  • New cli/run_config_report.py with one pure function: build_run_config_markdown(selections, config, version) -> str
  • cli/main.py:save_report_to_disk() gains optional selections/config kwargs; when both are passed, writes run_config.md. Backwards compatible — existing callers that don't pass them still work.
  • 3 unit tests in tests/test_run_config_report.py (@pytest.mark.unit)
  • CHANGELOG updated under [Unreleased] / Added

Sample output

# Run Configuration

| Field | Value |
|-------|-------|
| tradingagents version | 0.2.4 |
| Ticker | NVDA |
| Analysis date | 2026-05-04 |
| Analysts | market, news, fundamentals |
| Research depth | 1 |
| LLM provider | ollama |
| Quick-thinking model | qwen3:latest |
| Deep-thinking model | gpt-oss:latest |
| Backend URL | http://localhost:11434/v1 |
| Max debate rounds | 1 |
| Max risk discuss rounds | 1 |
| Checkpoint enabled | False |

Tests

$ python -m pytest -m unit
====================== 48 passed, 63 deselected in 1.24s =======================

(45 existing + 3 new for the markdown builder.)

djconnexion77 and others added 4 commits May 10, 2026 16:23
Adds tradingagents.__version__ resolved from installed package metadata
(pyproject.toml). Used by the upcoming run-configuration report (TauricResearch#752)
to record which tradingagents version produced each analysis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pure function that renders a markdown summary of the run parameters
(ticker, analyst selections, LLM provider/models, debate rounds, and
provider-specific reasoning effort). Provider-specific fields render
only when set, so Ollama runs don't surface empty OpenAI/Google rows.

Three unit tests cover happy path, omission of unset keys, and the
provider-specific section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rch#752)

save_report_to_disk() now accepts optional `selections` and `config`
kwargs. When both are provided, a `run_config.md` is written at the
root of the report directory capturing tradingagents version, run
parameters, LLM provider/models, and provider-specific reasoning
parameters (only those that are set).

Backwards compatible — existing callers that don't pass selections/config
get the original behaviour. The CLI's run_analysis() now threads both
dicts through to the save call.

Closes TauricResearch#752.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a run configuration report feature that captures the parameters used for each analysis, such as the package version, ticker, models, and provider-specific reasoning settings. The changes include a new run_config_report.py module, updates to the CLI saving logic in main.py, and the addition of unit tests. Feedback suggests moving local imports to the top of the file for PEP 8 compliance, using constants for the report filename to avoid hardcoding, and capitalizing labels in the markdown output for consistency.

Comment thread cli/main.py
Comment on lines +742 to +743
from tradingagents import __version__ as _ta_version
from cli.run_config_report import build_run_config_markdown
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Local imports inside functions are generally discouraged unless they are necessary to avoid circular dependencies. Since tradingagents and cli.run_config_report are part of the project and don't seem to cause circularity here, moving these to the top of the file would improve readability and follow PEP 8 more closely.

Comment thread cli/main.py
)
console.print(f"\n[green]✓ Report saved to:[/green] {save_path.resolve()}")
console.print(f" [dim]Complete report:[/dim] {report_file.name}")
console.print(f" [dim]Run config:[/dim] run_config.md")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename run_config.md is hardcoded here and in save_report_to_disk. If the filename is ever changed in the saving logic, this print statement will become incorrect. Consider defining a constant for the filename or having save_report_to_disk return the names of all files it created to ensure consistency.

Comment thread cli/run_config_report.py
) or "—"

base_rows = [
_row("tradingagents version", version),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the other labels in the table (e.g., 'Ticker', 'Analysts', 'Research depth'), this label should be capitalized. Using 'TradingAgents version' would also match the project's branding in other parts of the CLI.

Suggested change
_row("tradingagents version", version),
_row("TradingAgents version", version),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add report with run configuration details

1 participant