sync update from LAN repo (source ji @ 85078a31)

This commit is contained in:
gozeros committed 2026-10-21 15:09:16 +08:00
1 parent 5d6627af50
commit e602d88695
864 files changed
+99150 -6346

No files matched your search

@@ -219,14 +219,17 @@ async def run_agent(
logger.warning("Could not capture pre-run checkpoint snapshot for run %s", run_id, exc_info=True)
# 2. Publish metadata — useStream needs both run_id AND thread_id
await bridge.publish(
run_id,
"metadata",
{
"run_id": run_id,
"thread_id": thread_id,
},
)
metadata_event: dict[str, Any] = {
"run_id": run_id,
"thread_id": thread_id,
}
retrieval_trace = (record.metadata or {}).get("knowledge_retrieval_trace")
if isinstance(retrieval_trace, dict):
metadata_event["knowledge_retrieval_trace"] = retrieval_trace
metadata_event["knowledge_retrieval_url"] = (
f"/api/threads/{thread_id}/reference-batches"
)
await bridge.publish(run_id, "metadata", metadata_event)
# 3. Build the agent
from langchain_core.runnables import RunnableConfig