WeKnora/internal/router
Fei.Chen 86136b25e3
fix(session): serve org-shared KB images through the message file proxy (#3069)
* fix(session): serve org-shared KB images through the message file proxy

The message-scoped file proxy only authorized resources whose tenant
matched the message's agent tenant, so replies produced by an agent of
the caller's own workspace over an org-shared knowledge base rendered
text but lost every image with 403 (#3022).

Fall back to the org-share relation for exactly that case: the
message's persisted retrieval references must contain the resource
handle (chunk evidence — an unrelated handle from the owner tenant
cannot ride along), the reference's knowledge base must belong to the
resource's tenant, and that KB must still be shared to the caller with
at least viewer permission. Messages written before agent_tenant_id
existed get the same fallback before the shared-agent relation is
demanded; the shared-agent path itself is unchanged.

* fix(session): prove shared-KB images from agent steps and image_info

Smart-reasoning turns never persist KnowledgeReferences, and OCR hits often
keep the resource handle only in image_info. Collect tool retrieval onto the
message and accept that evidence in the message-file proxy so org-shared KB
images stop 403ing.

* fix(session): keep shared-KB image evidence in the message-file proxy

Drop the agent-engine KnowledgeRefs collector so pre-push does not lint the
whole agent package. AgentSteps already persist knowledge_search hits, which
is enough for the proxy to authorize org-shared images.

---------

Co-authored-by: vicfei <vicfei@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 15:43:09 +08:00
..
deployment_capabilities.go feat: require opt-in for the Docker sandbox backend (#2936) 2026-09-01 15:42:28 +08:00
deployment_capabilities_test.go feat: require opt-in for the Docker sandbox backend (#2936) 2026-09-01 15:42:28 +08:00
files.go fix(session): serve org-shared KB images through the message file proxy (#3069) 2026-09-07 15:43:09 +08:00
rbac.go feat(sandbox): expose tenant skill management over HTTP and in the console (#2789) 2026-08-25 11:28:12 +08:00
rbac_selfcheck_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router.go fix(session): serve org-shared KB images through the message file proxy (#3069) 2026-09-07 15:43:09 +08:00
router_api_key_capabilities_test.go fix(models): show usage details when deletion is blocked (#2975) 2026-09-02 17:20:37 +08:00
router_api_key_management_test.go feat: support updating API key configuration 2026-08-12 11:43:03 +08:00
router_files_test.go fix(session): serve org-shared KB images through the message file proxy (#3069) 2026-09-07 15:43:09 +08:00
router_knowledge_download_test.go fix(knowledge): restrict source file download to Editor and above 2026-07-23 22:19:39 +08:00
router_presigned_test.go refactor(api-keys): remove API key reset endpoint and update documentation 2026-07-07 12:00:13 +08:00
router_static_test.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
router_wiki_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
routes_agent.go feat(skills): store skills in a tenant catalog and install per sandbox 2026-08-28 15:17:37 +08:00
routes_auth_tenant.go feat(sandbox): inject per-user and workspace skill env vars at execution 2026-08-27 14:32:00 +08:00
routes_chat.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
routes_infra.go feat(skills): add StopSkill functionality to abort in-flight installs 2026-09-02 15:08:05 +08:00
routes_knowledge.go feat(knowledge): browse folders like a file manager and allow re-filing 2026-08-04 20:45:29 +08:00
routes_memory.go feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
static.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
sync_task.go feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
sync_task_retry_test.go fix: retry document summaries before fallback 2026-08-05 19:29:32 +08:00
task.go feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
task_inspector.go feat(runtime): add bulk purge for archived queue tasks and chat_attachment i18n 2026-07-23 16:52:35 +08:00
task_inspector_errors.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_errors_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_kb_cancel_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
task_inspector_runtime_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00