treat negative priority for data providers as disabling - #1230
treat negative priority for data providers as disabling#1230littlebirds wants to merge 1 commit into
Conversation
🤖 自动审查报告
📁 修改的文件
🧠 AI 代码审查意见结论: Ready to Merge 结构化审查结果
必改项 (0 条)无。 建议项 (2 条)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50c5afef7e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # Token 配置且 API 初始化成功,提升为最高优先级(与 efinance 同级, | ||
| # 通过 stable sort 顺序保证 Tushare 在前) | ||
| logger.info("✅ 检测到 TUSHARE_TOKEN 且 API 初始化成功,Tushare 数据源优先级提升为最高 (Priority 0)") | ||
| return 0 |
There was a problem hiding this comment.
Respect explicit TUSHARE_PRIORITY disable setting
When TUSHARE_TOKEN is present, _determine_priority() now unconditionally returns 0, so an explicit TUSHARE_PRIORITY=-1 is ignored and the fetcher remains active. This breaks the new contract introduced in this change (negative priority = disabled) and means users cannot actually disable Tushare in token-enabled environments, even though .env.example now documents that they can.
Useful? React with 👍 / 👎.
PR Type
Background And Problem
请描述当前问题、影响范围与触发场景。
Scope Of Change
请列出本 PR 修改的模块和文件范围。
Issue Link
必须填写以下之一 / Fill in one of:
Fixes #<issue_number>Refs #<issue_number>默认的数据源优先级对港股会使用错误的行情数据,需要能配置关闭
Verification Commands And Results
请填写你实际执行过的命令和关键结果(不要只写"已测试")。
(EN) Paste the commands you actually ran and their key output (don't just write "tested"):
关键输出/结论 / Key output & conclusion:
Compatibility And Risk
请说明兼容性影响、潜在风险(如无请写
None)。(EN) If this PR changes third-party model/API compatibility, request parameters, routing prefixes, or provider fallback behavior, include an official source link or announcement and clarify whether the rule is permanent, runtime-specific, or a temporary compatibility workaround.)
(EN) If this PR depends on a specific runtime or pinned dependency window (for example a LiteLLM version range, OpenAI-compatible routing, or YAML alias behavior), state the compatibility window you verified and which code paths were covered.)
(EN) If this PR touches runtime config save/cleanup/migration/backfill logic, explicitly describe whether existing config is rewritten, cleared, migrated, or left intact, and how users can restore the previous behavior.)
Rollback Plan
请至少写一句可执行的回滚方案(必填)。
(EN) Provide at least one actionable rollback step (required).
revert this PR),并说明是否需要额外回滚配置或数据迁移。(EN) For compatibility fixes, include the minimal rollback path (for example
revert this PR) and whether any additional config or data rollback is required.)EXTRACT_PROMPT Change (if applicable)
若本 PR 修改了
src/services/image_stock_extractor.py中的EXTRACT_PROMPT,请在此处粘贴完整变更后的 prompt。If this PR changes
EXTRACT_PROMPTinsrc/services/image_stock_extractor.py, paste the full updated prompt here:展开 / Expand: Full EXTRACT_PROMPT
Checklist
docs/CHANGELOG.md;README.md仅在首页级信息变化时更新,细节优先写入docs/*.md/ If user-visible changes are included, relevant docs anddocs/CHANGELOG.mdare updated;README.mdis updated only for homepage-level changes, with details kept indocs/*.md