This commit is contained in:
SengokuCola
2025-04-26 12:21:11 +08:00
parent 08be34a581
commit 510aa7a12d
2 changed files with 4 additions and 22 deletions

View File

@@ -111,11 +111,6 @@ class SubHeartflowManager:
# 设置状态为ABSENT释放资源
if subheartflow.chat_state.chat_status != ChatState.ABSENT:
logger.debug(f"[子心流管理] 设置 {stream_name} 状态为ABSENT")
states_num = (
self.count_subflows_by_state(ChatState.ABSENT),
self.count_subflows_by_state(ChatState.CHAT),
self.count_subflows_by_state(ChatState.FOCUSED),
)
await subheartflow.set_chat_state(ChatState.ABSENT)
else:
logger.debug(f"[子心流管理] {stream_name} 已是ABSENT状态")
@@ -284,12 +279,6 @@ class SubHeartflowManager:
logger.debug(f"{log_prefix} 已达专注上限 ({current_focused_count}/{focused_limit})")
return
states_num = (
self.count_subflows_by_state(ChatState.ABSENT),
self.count_subflows_by_state(ChatState.CHAT),
current_focused_count,
)
for sub_hf in list(self.subheartflows.values()):
flow_id = sub_hf.subheartflow_id
stream_name = chat_manager.get_stream_name(flow_id) or flow_id
@@ -340,13 +329,6 @@ class SubHeartflowManager:
subflows_snapshot = list(self.subheartflows.values())
deactivated_count = 0
# 预先计算状态数量,因为 set_chat_state 需要
states_num_before = (
self.count_subflows_by_state(ChatState.ABSENT),
self.count_subflows_by_state(ChatState.CHAT),
self.count_subflows_by_state(ChatState.FOCUSED),
)
try:
for sub_hf in subflows_snapshot:
flow_id = sub_hf.subheartflow_id