Skip to content

[pull] main from virattt:main#31

Open
pull[bot] wants to merge 508 commits intoBostt:mainfrom
virattt:main
Open

[pull] main from virattt:main#31
pull[bot] wants to merge 508 commits intoBostt:mainfrom
virattt:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented May 3, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels May 3, 2025
virattt and others added 14 commits February 2, 2026 15:45
- Changed margin check from total cash to available cash (cash - margin_used)
- Prevents overleveraging when existing margin is already tied up
- Added test case for available_cash scenario
- Closes #418
The previous implementation computed std() of only the negative excess
returns, which overstates downside risk by excluding zero-return periods
and applying Bessel's correction. The standard Sortino ratio uses target
downside deviation: sqrt(mean(min(excess, 0)^2)) across all periods.
fix: use target downside deviation in Sortino ratio
Bare `except:` catches all BaseException subclasses including
KeyboardInterrupt, SystemExit, and MemoryError, making it impossible
to interrupt the program and silently hiding parsing errors.

Replace all 5 bare `except:` in api.py with `except Exception as e:`
and add logger.warning() calls so parse failures are visible in logs.

This addresses issue #448 where users see "Error in analysis, using
default" with no diagnostic information.

Closes #448
…ls.py

1. get_model() silently returns None for ALIBABA, META, and MISTRAL
   providers because no elif branch handles them. Callers then call
   None.invoke() raising an opaque AttributeError. Add an explicit
   else branch that raises ValueError with a clear message listing
   all supported providers.

2. Remove duplicate `from langchain_openai import ChatOpenAI` on line 9
   (already imported on line 8).
The Financial Datasets API does not always return an `author` field in
company news responses. This causes a Pydantic validation error that
prevents the news sentiment agent from processing any articles,
ultimately leading to an UnboundLocalError crash downstream.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
virattt and others added 15 commits April 7, 2026 11:34
The Cache class had zero test coverage. These tests verify:
- Initialization with empty stores
- Global singleton behavior (get_cache)
- Deduplication logic in _merge_data
- All five cache types (prices, financial metrics, line items,
  insider trades, company news)
- Key-field based deduplication preserves original values
- Independent ticker isolation
Initialize the sentiment aggregation state before branching on the
fetched company news and normalize missing responses to an empty
list.

This prevents an UnboundLocalError when get_company_news() returns
None or no articles while downstream logic still references the
classification counters and aggregated results.

Co-Authored-By: GPT 5.4 <codex@openai.com>
Fix news sentiment handling when news is missing
Adds Kimi (Moonshot) alongside the existing providers so users can run
the hedge fund on kimi-k2 / kimi-latest / moonshot-v1-128k without
going through OpenRouter.

- ModelProvider.KIMI + LLMModel.is_kimi()
- get_model() branch using ChatOpenAI with base_url
  (https://api.moonshot.ai/v1 by default; MOONSHOT_BASE_URL /
  KIMI_BASE_URL override, e.g. https://api.moonshot.cn/v1 for mainland
  China)
- Accepts MOONSHOT_API_KEY or KIMI_API_KEY
- Three entries in api_models.json (kimi-k2-0905-preview, kimi-latest,
  moonshot-v1-128k)
- Surfaces the new key in .env.example and the frontend API-keys panel

Closes #578

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(llm): add Moonshot Kimi as a model provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.