修复附件询价:公网打开上传页不再出骨架 JSON,未上传时打字能正常回话。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 18:54:41 +08:00
co-authored by Cursor
parent 49faa35f47
commit 8e73af0d03
6 changed files with 150 additions and 15 deletions
@@ -79,6 +79,21 @@ def is_active_attachment_wait(sender_id: str, *, now: Optional[float] = None) ->
return get_attach_wave_book().active(sender_id, now=now) is not None
def is_idle_attachment_wait(sender_id: str, *, now: Optional[float] = None) -> bool:
"""已发卡但还没传 Excel/PDF/图。此时销售打字应走文字询价。"""
wave = get_attach_wave_book().active(sender_id, now=now)
return wave is not None and not wave.started
def abandon_idle_attach_wait(sender_id: str) -> bool:
"""
作废未开始认的等待票。已开始认返回 False。
副作用:旧上传卡随后按过期拒绝。
"""
return get_attach_wave_book().abandon_if_idle(sender_id)
def append_attach_text(sender_id: str, text: str) -> bool:
"""认完之前的字并进本票,不走文字询价。"""
return get_attach_wave_book().append_follow_text(sender_id, text)