Files
X-Financial/document/development/2026-07-17/dev-logs/bugs/knowledge-scheduler-default-tenant.md
caoxiaozhu 787bc3a481 feat(platform): close AI expense value loop
Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
2026-07-17 14:14:08 +08:00

9 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 修复记录
- 12:45修复知识索引调度器使用默认租户、后台线程信任传入上下文导致任务错误归属的问题。
- Git 提交检查:已执行 `git fetch --all --prune``git status -sb``git log HEAD..@{u}``git log @{u}..HEAD`upstream 无新提交,本地 `main` ahead 17既有提交未被改写。
- 修改:调度器查询租户注册表并逐个处理 `status=active` 的租户;无活跃租户时跳过;内部 Hermes 身份显式携带 tenant索引 worker 从数据库 Agent Run 的 route/ontology 重新取得并比对 tenant拒绝缺失或冲突上下文。
- 操作同步任务、活跃任务复用、stale 状态回收和 ingest 状态写入均绑定当前 tenant不再构造无作用域 KnowledgeService。
- 验证:容器内 active/suspended 调度隔离、Agent Run tenant 冲突、知识同步和既有知识组合测试通过;扫描全部 `KnowledgeService`/`KnowledgeRagService` 调用点,生产代码仅保留显式 tenant 或显式 platform 构造。
- 影响:定时知识任务不会再落入默认企业或把一个租户的文档写进另一个租户的索引;后台参数被篡改或丢失时任务 fail-closed。