Skip to content

fix(tradingagents): preserve configured timeouts and expose provider errors - #176

Merged
TNT-Likely merged 3 commits into
mainfrom
fix/remove-tradingagents-output-cap
Oct 4, 2026
Merged

TNT-Likely merged 3 commits into
mainfrom
fix/remove-tradingagents-output-cap

Conversation

@TNT-Likely

Copy link
Copy Markdown
Owner

Background

TradingAgents configurations saved by the UI include auto_trigger, which the agent constructor did not accept. The execution entry point caught the resulting TypeError and silently created a default agent, resetting a configured 600-second model timeout to 300 seconds. Provider failures such as GLM HTTP 400/code 1301 were also replaced with a generic request error, hiding the actionable reason.

Changes

  • Accept the linked-trigger configuration without resetting execution settings, read it from the actual AgentConfig.config ORM field, and log effective timeout and model settings.
  • Remove PanWatch's output token cap from seeded settings, saved UI configurations, and model client parameters. Retain the legacy constructor argument as an ignored compatibility field.
  • Persist bounded, redacted HTTP status and provider code/message diagnostics for manual and scheduled runs; preserve those details in progress responses.
  • Restore the latest failed run when reopening the deep-analysis dialog, wrap long error text, and ignore late recovery responses after switching stocks.

Validation

  • .venv/bin/python -m pytest tests/test_ai_errors.py tests/test_tradingagents_agent.py tests/test_tradingagents_auto_trigger.py tests/test_tradingagents_progress_recovery.py tests/test_tradingagents_v050_compat.py tests/test_tradingagents_trigger_idempotency.py -q — 86 passed.
  • pnpm --dir frontend exec vitest run tests/analysis/deep-analysis-modal.test.tsx tests/settings/deep-analysis-timeouts.test.tsx — 9 passed.
  • Frontend check:ui, check:i18n, check:market-colors, and build — passed.
  • git diff --check origin/main...HEAD — passed.
  • A live GLM-5.3-flash analysis using existing local settings completed all 17 model calls in 45 minutes 22 seconds. Individual calls lasting 386 and 398 seconds completed successfully with the configured 600-second timeout.
  • Checked desktop and 390 px mobile layouts in light/dark themes, scrolling, Escape dismissal, and reopening the live task and saved report.
  • Verified the original HTTP 400/code 1301 response using the installed LangChain exception type and failure-restoration regression tests.

Boundaries and risks

  • No database migration or model reasoning-depth changes.
  • Provider moderation remains in effect. The live run did not reproduce code 1301; its diagnostic formatting and failure view are covered by the supplied response and regression tests.
  • Removing the host output cap uses provider defaults and may increase output length and latency. Existing overall and request timeout settings remain available.
  • Local proposal and QA files under .docs/ are excluded from this PR.

Follow-up

None required for this release.

@TNT-Likely
TNT-Likely merged commit 42a1a60 into main Oct 4, 2026
3 checks passed
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.

1 participant