WeKnora/internal
ShadowSmallBaby c4ce9a95a8 fix(agent): 共享知识库在 runtime_context 中 doc_count 为 0
getKnowledgeBaseInfos 用请求上下文的 tenant 去查文档和 FAQ 列表,
而直接共享过来的知识库属于源 tenant。文档列表是按 tenant 隔离的,
于是共享知识库在 runtime_context 里渲染成 doc_count=0、recent_docs 为空,
模型看不到这些知识库里有内容。

改为按知识库逐个解析查询用的 tenant:tenant 取自 SearchTargets,
buildSearchTargets 已经为每个知识库解析并鉴权过,直接共享的知识库
在那里带着源 tenant。tenant 映射不能只在 SearchTargets 分支里取——
KnowledgeBases 同样会包含共享知识库的 ID(KBSelectionMode="all"
和 @提及两条路径都会写进去),所以两个分支都从 SearchTargets 取。

只放宽 metadata 查询用的 tenant,不改变参与检索的知识库集合;
映射里没有的知识库回落到请求 tenant。

租户解析和 ID 去重均复用 types.SearchTargets 已有的
GetKBTenantMap 和 GetAllKnowledgeBaseIDs。

Shadow
2026-08-12 15:55:51 +08:00
..
agent feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
application fix(agent): 共享知识库在 runtime_context 中 doc_count 为 0 2026-08-12 15:55:51 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
config fix(config): 补齐 WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS 的 env 读取 2026-08-10 19:40:09 +08:00
container feat(datasource): add Tencent IMA datasource 2026-08-12 14:56:25 +08:00
database fix(knowledge): address auto-tag review findings 2026-08-07 15:01:01 +08:00
datasource feat(datasource/ima): sync IMA notes via the note OpenAPI 2026-08-12 14:56:25 +08:00
errors refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
event feat(mcp): prompt and resume OAuth authorization mid-conversation 2026-06-29 23:22:28 +08:00
handler feat: support updating API key configuration 2026-08-12 11:43:03 +08:00
im feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
infrastructure feat: add Exa WebSearch (#2617) 2026-08-11 17:05:52 +08:00
logger feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
mcp fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
middleware feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login 2026-08-11 15:41:48 +08:00
modelcontext feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
models fix(embedding): validate WeKnoraCloud response indexes 2026-08-11 16:59:48 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router feat: support updating API key configuration 2026-08-12 11:43:03 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox feat(sandbox): enhance logging for sandbox operations and error diagnostics 2026-08-12 10:53:46 +08:00
searchutil fix(chunks): trim trusted overlaps by exact position, not text search 2026-08-06 12:26:15 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
stream feat(redis): support TLS for Redis connections (#1930) 2026-07-06 23:02:02 +08:00
tracing/langfuse feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
types feat(datasource): add Tencent IMA datasource 2026-08-12 14:56:25 +08:00
utils fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00