Skip to content

Add show_recent_detail parameter to suppress per-symbol recent returns in Feishu card#274

Merged
zengbin93 merged 2 commits intomasterfrom
copilot/fix-push-strategy-message-error
Feb 26, 2026
Merged

Add show_recent_detail parameter to suppress per-symbol recent returns in Feishu card#274
zengbin93 merged 2 commits intomasterfrom
copilot/fix-push-strategy-message-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Stock-selection strategies with large symbol universes (80+ symbols) cause Feishu's 10208: message content too long error because the "最近3个交易日收益" table renders one row per symbol.

Changes

  • StrategyCard.__init__() — adds show_recent_detail: bool = True parameter, stored as instance attribute
  • StrategyCard.build() — gates the recent-returns section on self.show_recent_detail in addition to the existing <= 30 symbol auto-skip:
    include_recent = self.show_recent_detail and len(latest_positions) <= 30
  • push_strategy_latest() — exposes show_recent_detail as a top-level parameter and passes it through to StrategyCard

Usage

# For stock-selection strategies with many symbols, disable the per-symbol table
push_strategy_latest(
    strategy="选股策略",
    dfw=dfw,
    feishu_key=key,
    show_recent_detail=False  # prevents 10208 error on large symbol sets
)
Original prompt

This section details on the original issue you should resolve

<issue_title>使用 czsc/fsa/push_strategy_latest.py 推送策略更新消息错误</issue_title>
<issue_description>报错信息 - {'code': 10208, 'data': {}, 'msg': 'message content too long'}

Image

诊断问题发现:针对选股类的策略,由于标的数量太多,近3日收益的数据庞大导致出了问题。

建议修复一下。增加一个参数来控制近3日收益的显示是否包含详细的品种。</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…test to fix message too long error

Co-authored-by: zengbin93 <[email protected]>
Copilot AI changed the title [WIP] Fix push strategy update message error for long content Add show_recent_detail parameter to suppress per-symbol recent returns in Feishu card Feb 26, 2026
@zengbin93 zengbin93 marked this pull request as ready for review February 26, 2026 12:58
@zengbin93 zengbin93 merged commit c4b4db8 into master Feb 26, 2026
4 checks passed
@zengbin93 zengbin93 deleted the copilot/fix-push-strategy-message-error branch February 26, 2026 13:23
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.

使用 czsc/fsa/push_strategy_latest.py 推送策略更新消息错误

2 participants