fix: preserve sell event routing owner

This commit is contained in:
Hermes Agent
2026-09-20 20:34:00 +09:00
parent 3f6a967aa1
commit c66acf6e47
20 changed files with 766 additions and 32 deletions
+11
View File
@@ -327,6 +327,16 @@ class SlotService:
raise SlotTransitionError(
f"sell() requires holding state, got: {slot.status.value}"
)
# req-0011 / ac-0038: autonomous sells have no SellIntent, so persist
# the already-owned SELL identity or inherit the holding owner.
sell_event_owner = next(
(
value
for value in (slot.sell_strategy_id, slot.strategy_id)
if isinstance(value, str) and value.strip()
),
None,
)
self.transit_slot(
slot_id,
SlotState.HOLDING,
@@ -334,6 +344,7 @@ class SlotService:
reason=reason,
actor=actor,
limit_price=limit_price,
sell_strategy_id=sell_event_owner,
)
# ------------------------------------------------------------