Add end-plan action; never show unfilled option legs as open.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-20 09:36:46 +08:00
parent 8597e47596
commit a43cb35d9a
6 changed files with 369 additions and 5 deletions
+6 -1
View File
@@ -201,7 +201,12 @@ def legs_contract_summary(legs: list[dict[str, Any]]) -> str:
for leg in legs:
role = str(leg.get("leg_role") or "")
st = str(leg.get("status") or "").strip().lower()
suffix = "(待补)" if st == "pending" else ""
if st == "pending":
suffix = "(待补)"
elif st in ("cancelled", "canceled"):
suffix = "(未成交)"
else:
suffix = ""
if role == "perp":
name = str(leg.get("symbol") or "永续")
parts.append(f"永续 {name}{suffix}")