sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -30,19 +30,49 @@ EXCLUDED_SYSTEM_THREAD_TYPES = frozenset(
"deep_research",
"writing_setup",
"report_structure_setup",
"task-analysis",
"task-analysis-qa",
"task_deeplink",
}
)
# 这些系统线程 id 只存在于编排内部,不进「最近的对话」;loopback 派活必须能跨
# 「点击触发的 HTTP 用户」和「绑定 created_by 签发的 JWT」读写,否则会 404 not accessible。
SHARED_ACCESS_THREAD_TYPES = frozenset(
{
"roundtable",
"task-analysis",
"task-analysis-qa",
}
)
def is_excluded_system_thread(metadata: dict[str, Any] | None) -> bool:
"""Return True when a thread should be hidden from user conversation lists."""
"""Return True when a thread should be hidden from user conversation lists.
Task-analysis seat runs created before ``thread_type`` was stamped still
carry ``task_analysis_seat``. Those rows stay in the execution record and
out of recent chats.
"""
md = metadata or {}
if md.get("system"):
return True
seat = md.get("task_analysis_seat")
if isinstance(seat, str) and seat.strip():
return True
thread_type = md.get("thread_type")
return isinstance(thread_type, str) and thread_type in EXCLUDED_SYSTEM_THREAD_TYPES
def is_shared_access_thread(metadata: dict[str, Any] | None) -> bool:
"""Return True when any authenticated caller may read/write this thread."""
md = metadata or {}
if md.get("taskId"):
return True
thread_type = md.get("thread_type")
return isinstance(thread_type, str) and thread_type in SHARED_ACCESS_THREAD_TYPES
class ThreadMetaStore(abc.ABC):
@abc.abstractmethod
async def create(