Skip to content

feishu: card rollover never fires — long tasks silently stop updating #814

Description

@cuipengcx90

Symptom

Long Feishu tasks stop updating their card around step ~50 while the agent keeps running. The user has to send "继续" to get a working card back, and any long task reproduces it (198 occurrences of the card failure in a single session log).

Root cause (two defects)

  1. _rollover_locked() bumps page_no and clears msg_id but not self.steps. _build_locked() iterates the full self.steps, so the "new" card is exactly as large as the overflowing one and fails the same way — rollover is a no-op.

  2. _push_sync() returns (False, False) when the create path fails, while _worker_loop rolls over only on limit=True. Once msg_id is None, every later push takes the create path, returns limit=False, and rollover never runs again — the card becomes permanently unsendable.

Reproduction

Any session where accumulated steps exceed the card size limit (roughly 50 steps at _DETAIL_LIMIT = 4000). The log then repeats:

发送失败: 230099, Failed to create card content, ext=ErrCode: 200800; ErrMsg: create universal card fail;

while 上一张工作卡片达到飞书限制 (the rollover note) never appears — direct proof that rollover never fired.

Suggested fix

  • Clear self.steps in _rollover_locked() and carry turn_base so step numbering stays contiguous.
  • Roll over proactively when steps reaches a threshold, instead of waiting for the API to reject the card.
  • Return limit=True from the create path on failure so the caller can roll over and retry.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions