fix(skill-review): use runtime.context to get thread_id
This commit is contained in:
1 parent
23a18ec318
commit
2a8364e902
2 files changed
+2
-6
No files matched your search
+1
-5
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user