fix(skill-review): use runtime.context to get thread_id

This commit is contained in:
xuhd committed 2026-06-05 13:32:19 +08:00
1 parent 23a18ec318
commit 2a8364e902
2 files changed
+2 -6

No files matched your search

@@ -44,11 +44,7 @@ class SkillReviewMiddleware(AgentMiddleware[SkillReviewMiddlewareState]):
try:
app_config = get_app_config()
messages = state.get("messages", []) if hasattr(state, "get") else []
thread_id: str = (
(runtime.config or {})
.get("configurable", {})
.get("thread_id", "")
)
thread_id: str = runtime.context.get("thread_id", "") if runtime.context else ""
if not thread_id:
return
maybe_start_review(thread_id, messages, app_config)
@@ -14,7 +14,7 @@ def _make_state(messages):
def _make_runtime(thread_id="thread-abc"):
runtime = MagicMock()
runtime.config = {"configurable": {"thread_id": thread_id}}
runtime.context = {"thread_id": thread_id} if thread_id else {}
return runtime