Skip to content

[Bug] recall API 返回其他用户的数据(多用户隔离失效) #62

@leyansoft

Description

@leyansoft

OpenClaw Version | OpenClaw 版本

Hermes Agent V 0.14

Plugin Version | 插件版本

TDAI Memory Gateway v0.1.0

Operating System | 操作系统

Windews/WSL(Ubuntu 24.04)

System Specification | 系统配置

No response

Describe the bug | 问题描述

环境

TDAI Memory Gateway v0.1.0,standalone 模式(8420 端口)
后端:SQLite(BM25 enabled,embedding disabled)
LLM:qwen3-80b,共享模型端点 http://10.20.48.2:8002/v1

问题描述
A 用户(leyan)调用 POST /recall 时,返回的 persona 和 scene navigation 是 B 用户(lejun)的数据:

persona 内容不属于 leyan — 描述的是"视频推荐系统项目"、"敏捷系统构建者",与 leyan 的实际工作(爱马仕天团/股票交易)完全不符
scene 路径指向 lejun 的目录 — /home/lejun/.memory-tencentdb/memory-tdai/scene_blocks/...
leyan 的本地数据全空 — l0_conversations: 0、l1_records: 0、scene_blocks/ 空目录、persona.md 不存在
背景
5 月 17 日,同事 lejun 部署了 TDAI 记忆系统,推荐 leyan 使用
两人使用同一个模型端点(10.20.48.2:8002 qwen3-80b)
各自有独立的 TDAI Gateway 实例和独立的 dataDir
lejun 的 $HOME=/home/lejun/,leyan 的 $HOME=/home/leyan/
关键疑点
leyan 的 dataDir 是 /home/leyan/.memory-tencentdb/memory-tdai/,数据库中没有任何数据
但 recall 返回的 persona 内容是 5 月 17 日生成的(lejun 部署当天),场景块路径全是 /home/lejun/
磁盘上搜不到任何包含 lejun 的文件(包括 WAL、SHM)
systemctl restart tdai-gateway 后 uptime 仍在增长,说明重启可能没生效
这是否意味着 persona/scene 数据通过共享模型端点泄露了? 如果 LLM 在 persona 生成时将场景路径硬编码到了输出中,而 LLM 的输出被缓存或复用了,就会导致跨用户数据泄漏
已排查
persona.md 文件不存在于 leyan 的 dataDir
scene_index.json 不存在于 leyan 的 .metadata/
SQLite 所有表为空(l0、l1、fts)
strings vectors.db* 搜索 lejun 无结果
find ~/.memory-tencentdb/ -exec grep -l "lejun" 无结果

To Reproduce | 复现步骤

  1. User A (lejun) deploys TDAI Gateway on 2026-05-17, generates persona/scene data
  2. User B (leyan) deploys TDAI Gateway with separate dataDir:
    $HOME=/home/leyan
    dataDir=/home/leyan/.memory-tencentdb/memory-tdai/
  3. User B's dataDir is completely empty:
    • persona.md does not exist
    • scene_blocks/ is empty
    • .metadata/scene_index.json does not exist
    • SQLite: l0_conversations=0, l1_records=0
  4. Both users share the same LLM endpoint (10.20.48.2:8002)
  5. User B calls: POST http://127.0.0.1:8420/recall
    -H "Content-Type: application/json"
    -d '{"query":"test","session_key":"test","user_id":"default"}'
  6. Actual result: Returns User A's persona content and scene paths:
    "Path": "/home/lejun/.memory-tencentdb/memory-tdai/scene_blocks/..."
  7. Expected result: Empty or user-specific data only

Expected behavior | 预期行为

多用户共享同一个模型端点时,persona/scene 数据应严格隔离
当本地数据为空时,recall 不应返回其他用户的数据
路径应基于运行时 $HOME 动态生成,不应硬编码

Error Logs / Screenshots | 报错日志/截图

No response

Additional context | 补充信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions