Merge branch 'ji' into master
按钮管理「登录参数」两套实现冲突解决——两分支各自独立给跳转按钮加了登录态追加能力, 二者正交、保留两套,互不影响: - master: login_params (JSON 列 login_params_json,从 userInfo 解析,类似轻应用登录参数) - ji: append_auth + auth_token_param + auth_name_param (token 登录时追加 token1+用户名) 迁移 revision 碰撞修复(两分支都用了 20260625_01):重编号为线性链 20260620_02 → 20260625_01 (login_params) → 20260625_02 (auth_params) → 20260625_03 (users_approved) 并同步 column_additions_mysql.sql 注释里的 migration 编号。 前后端 task_buttons(model/sql/memory/router/前端 type·api·admin 页)均保留两套字段; 两份 CLAUDE.md 文档合并为同时记录两种机制。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
58357547c9
44 files changed
+1207
-46
No files matched your search
@@ -42,6 +42,12 @@ logger = logging.getLogger(__name__)
|
||||
_owner_cache: dict[str, str] = {}
|
||||
_owner_cache_lock = threading.Lock()
|
||||
_OWNER_CACHE_MAX = 4096
|
||||
_LOCAL_ONLY_THREAD_PREFIXES = ("open-", "__skill-review__")
|
||||
|
||||
|
||||
def _is_local_only_thread(thread_id: str | None) -> bool:
|
||||
"""Return True for synthetic threads that are never persisted in threads_meta."""
|
||||
return bool(thread_id) and str(thread_id).startswith(_LOCAL_ONLY_THREAD_PREFIXES)
|
||||
|
||||
|
||||
def _cache_get(thread_id: str) -> str | None:
|
||||
@@ -112,7 +118,7 @@ def resolve_path_user_id(thread_id: str | None) -> str:
|
||||
share the conversation read/write the same physical directory. For every
|
||||
other case it is the current login (``get_effective_user_id``).
|
||||
"""
|
||||
if not thread_id:
|
||||
if not thread_id or _is_local_only_thread(thread_id):
|
||||
return get_effective_user_id()
|
||||
cached = _cache_get(thread_id)
|
||||
if cached is not None:
|
||||
@@ -132,7 +138,7 @@ def resolve_path_user_id(thread_id: str | None) -> str:
|
||||
|
||||
async def aresolve_path_user_id(thread_id: str | None) -> str:
|
||||
"""Async variant of :func:`resolve_path_user_id` for FastAPI handlers."""
|
||||
if not thread_id:
|
||||
if not thread_id or _is_local_only_thread(thread_id):
|
||||
return get_effective_user_id()
|
||||
cached = _cache_get(thread_id)
|
||||
if cached is not None:
|
||||
|
||||
Reference in new issue
Block a user