Repository navigation
fsapp: roll over oversized Feishu task cards, keep turn numbering - #820
Open
louisss1016 wants to merge 1 commit into
Open
louisss1016 wants to merge 1 commit into
louisss1016 wants to merge 1 commit into
Conversation
…define#814) Long Feishu tasks stopped updating around step ~50: _push() swallowed the platform card-size error (230099/11310) and step() ignored the result, so the card silently froze while the agent kept running. - _push() returns (ok, limit); the create path also reports limit=True, since a None msg_id otherwise sends every later push down the failing create path (defect 2 in the issue) - new _rollover() clears steps and bumps page_no, so the continuation card is actually smaller than the overflowing one (defect 1); turn_base keeps Turn numbering contiguous across cards - proactive rollover at 50 steps (measured overflow ~58) instead of waiting for the API to reject the card - done()/fail() roll over and retry before falling back to plain text 11 new tests via the repo's ast/exec pattern; full suite 298 passed (same 3 pre-existing Windows-env failures as before).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #814.
What
Long Feishu tasks froze around step ~50 while the agent kept running:
_push()swallowed the platform card-size error (230099/11310/ element-exceeds-limit) andstep()ignored the result entirely, so nothing ever recovered.Changes (
frontends/fsapp.pyonly)_push()returns(ok, limit)and the create path now reportslimit=Trueon failure — withmsg_id is None, every later push takes the create path, so not rolling over made the card permanently unsendable (issue defect 2)._rollover()bumpspage_no, clearsmsg_id/final/steps, and posts a continuation note. Clearingstepsis the core of defect 1 — without it the "new" card is exactly as large as the overflowing one.turn_basecarries numbering across cards:Turn Nstays globally contiguous (powered by a monotonicturn_no), and the header shows📄 工作卡片 2._PAGE_STEPS = 50— the reporter measured real overflow at ~58 steps with 8000-char details, so the page flips before the API ever rejects the card (issue suggestion chore(gitignore): add mykey.py to ignore sensitive API keys and credentials #2).done()/fail()roll over and retry once before the existing plain-text fallback fires;done()restoresself.finalafter rollover so the final answer survives._patch_card()keeps returningbool(delegates to the new_patch_card_result()[0]), soupdate_message()and other callers are unaffected. Limit detection is factored into_is_card_limit_error()(case-insensitive markers).Important context found while implementing
The issue references
_rollover_locked()/_push_sync()/_worker_loopand_DETAIL_LIMIT = 4000— none of those exist on current main. A rollover implementation was merged in #209 (commitbf002e5b) but was dropped in the subsequent Feishu interface rework (df525560, 2026-05-21); main today has no rollover at all, and the original symptom reproduces structurally. This PR re-lands the rollover behavior adapted to the current_TaskCardstructure (no locks: hooks already run serialized on the agent loop, andstart/failuseasyncio.to_thread— same exposure as before, unchanged by this PR).@cuipengcx90 — as discussed, this stays scoped to the rollover defects; your button-pagination approach is complementary and I'm not touching it here.
Tests
frontends/tests/test_fsapp_card_rollover.py— 11 tests via the repo's ast/exec extraction pattern (fsapp.pyimportslark_oapi): reactive rollover with contiguous numbering, create-failure-as-limit retry, proactive threshold flip,done()/fail()recovery paths, fallback-once semantics, and the limit-error marker matching.Full suite: 298 passed; the 3 failures (
test_data_backupsymlink ×2,test_release_qualification) are pre-existing Windows-env issues, identical before and after this change.