Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Willem Jiang
2026-04-26 11:12:42 +08:00
committed by GitHub
parent a55de566b9
commit d9f7f658be
5 changed files with 12 additions and 5 deletions
@@ -57,10 +57,10 @@ class MemoryMiddleware(AgentMiddleware[MemoryMiddlewareState]):
if not config.enabled:
return None
# Get thread ID from runtime context
# Resolve thread ID from the runtime or configured fallback sources
thread_id = get_thread_id(runtime)
if not thread_id:
logger.debug("No thread_id in context, skipping memory update")
logger.debug("No thread_id could be resolved from runtime/config, skipping memory update")
return None
# Get messages from state