Commit 70679be8 by sunqi02

fix: post_observe hook 加 try/except 保护 ReAct 循环

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 01358f5c
...@@ -177,6 +177,7 @@ async def _post_observe_intent_hook( ...@@ -177,6 +177,7 @@ async def _post_observe_intent_hook(
注入后不触发新工具调用:消息作为 system 上下文注入,LLM 自然看到,不开启新 ReAct 循环。 注入后不触发新工具调用:消息作为 system 上下文注入,LLM 自然看到,不开启新 ReAct 循环。
""" """
try:
data = store.get(session_id) data = store.get(session_id)
if not data: if not data:
return None return None
...@@ -207,6 +208,11 @@ async def _post_observe_intent_hook( ...@@ -207,6 +208,11 @@ async def _post_observe_intent_hook(
"[intent_hook] session=%s 注入 %d 条新消息到 Agent memory + conversation_history", "[intent_hook] session=%s 注入 %d 条新消息到 Agent memory + conversation_history",
session_id, len(intent_msgs), session_id, len(intent_msgs),
) )
except Exception:
logger.warning(
"[intent_hook] session=%s intent_session 处理异常(不影响 ReAct 循环)",
session_id, exc_info=True,
)
return None return None
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!