WeKnora/internal
linus-liu-web 8319d59dd0
feat(datasource/dingtalk): 摄取钉钉"上传文件"(docx/pptx/xlsx/pdf) (#3786)
* feat(datasource/dingtalk): 摄取钉钉"上传文件"(docx/pptx/xlsx/pdf)

钉钉连接器此前只导入原生 .adoc 文档:知识库里的上传文件既不会出现在选择器里,
也不会被同步,而且没有任何提示。

- 节点判定拆成 isOnlineDocument / isBinaryDocument / binaryContentType,isDocument()
  变成"在线文档 ∪ 二进制文档",上传文件因此可被枚举与摄取;表格(axls)等其它原生
  类型仍不在其中,避免枚举出同步读不了的节点。
- 上传文件通过钉盘下载 API 逐字节传输,交给 WeKnora 自己的解析器:先用
  /v2.0/doc/dentries/{id}/queryDentryId 把节点 UUID 换成数字 spaceId/dentryId
  (存储 API 拒绝非数字 spaceId),再取预签名 URL 下载。
- 大小上限加在传输上而不是列表元数据上:node.size 与存储对象并不一致。
- 预签名 URL 短命且带版本,传输失败会用新签名重试。
- Validate 对上传文件"解析位置但不传 payload",凭证校验不必为每个候选文件下载
  数 MB;adoc 仍走 blocks API。
- 同步按类型分派:adoc 渲染 blocks,上传文件落原始字节并带上具体 MIME 类型与只含
  一个扩展名的文件名;下载失败与读取失败一样是可重试的失败项,不推进游标。

本提交只含 C(上传文件摄取)。不含:校验循环容错(A)、跳过项日志与可见性(B)、
原生表格 axls(D)、多维表/手工引用/前端(E)。

* test(datasource/dingtalk): 上传文件用例改用合成文档名与占位 ID

- 夹具、断言与文件名注释里的文档名统一换成合成名 Employee-Handbook.docx,
  用例语义不变:仍覆盖"名字已带扩展名时不重复追加"与 PK\x03\x04 字节断言。
- 去掉测试注释里"as verified against the live tenant"的表述,改为描述调用顺序。
- dentry 响应示例与用例中的数字 ID 换成明确占位符,不再出现可被误认的真实 ID。

* fix(datasource/dingtalk): 上传文件摄取改为数据源级开关,超限不再重试

评审意见(#3786):上传文件是本次新增的摄取路径,存量数据源升级后无需用户显式启用
就会在下一次同步(含增量)开始下载并向量化所选范围内的 docx/pptx/xlsx/pdf,可能
增加存储与 embedding 成本;同时单次下载里超出体积上限被当成可重试错误,没有
Content-Length 的超大文件会重签名再下满 3 次。

- 新增 `Settings.include_uploaded_files`(默认 false,未设置/非法值一律按 false)。
  读取走与本仓库语雀连接器同名的 settingBool(v, def),并新增 documentSettings /
  parseDocumentSettings 承载开关。
- 判定拆成"有没有读取路径"(isDocument)与"这个数据源收不收"(isIngestible):
  Validate 的探测、ListResources、全量同步与增量同步(共用 scanWorkspace)四处
  全部改用 isIngestible,关闭时行为与 main 一致。
- skipReason 对"能读但没开开关"的上传文件给出可操作的原因:说明
  include_uploaded_files 未启用,而不是伪装成类型不支持;媒体文件与真正没有
  摄取路径的类型保持原有说法。
- readLimited 改为返回哨兵错误 errDocumentTooLarge(同时包装上限字节数),
  fetchSigned 据此返回 retryable=false:体积是对象的属性,新签名只会拿到同样的
  字节。普通读错误仍然 retryable=true,仍会重签名重试。
- 前端数据源编辑弹窗(同步策略步骤)加对应开关,未触碰时不写回 settings;5 个
  语言包补齐文案。
- website-docs 钉钉一节写明支持范围、默认值、64 MiB 单文件上限与成本影响。

测试补 include_uploaded_files 的未设置/显式关闭/显式开启三种状态:校验、资源列表、
全量同步、增量同步四处各自断言,直接选择上传文件在关闭时仍是失败的资源;流式超限
用例断言签名查询与对象下载各只发生一次,另加"普通读错误仍重试"的用例。

---------

Co-authored-by: linus-liu-web <11640009+linus-liu-web@users.noreply.github.com>
Co-authored-by: linus-liu-web <linus-liu-web@users.noreply.github.com>
2026-10-09 10:56:04 +08:00
..
agent fix(wiki): 唯一写出口 UpdatePage 拦住丢表格行的机器重写(agent 整页写入不再静默改短页面) (#3793) 2026-10-09 10:55:28 +08:00
application fix(wiki): 唯一写出口 UpdatePage 拦住丢表格行的机器重写(agent 整页写入不再静默改短页面) (#3793) 2026-10-09 10:55:28 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
browserskill fix(browser): refine connection and preview UI with extension version 2026-09-23 10:57:59 +08:00
common fix(markdown): sanitize invalid UTF-8 and NUL bytes 2026-08-31 12:24:35 +08:00
config feat(auth): 新增仅限邀请注册档位 (#3900) 2026-09-30 13:32:55 +08:00
container feat(datasource): add Seafile data source connector (#3616) 2026-10-08 16:18:09 +08:00
database revert: take the plugin system back out of main 2026-09-26 14:58:18 +08:00
datasource feat(datasource/dingtalk): 摄取钉钉"上传文件"(docx/pptx/xlsx/pdf) (#3786) 2026-10-09 10:56:04 +08:00
embedpolicy fix(embed): enforce host origin allowlists on framed pages 2026-09-14 18:03:57 +08:00
errors feat(knowledge): flag documents that stop making progress (#3557) 2026-09-22 21:34:08 +08:00
event fix(agent): end the turn when the completion cap truncates an answer (#3449) 2026-09-20 13:17:50 +08:00
filetransport refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
handler fix(wiki): resolve titles for unloaded backlinks (#3931) 2026-10-09 10:50:52 +08:00
im fix(im): retry Yunzhijia attachment downloads (#3809) 2026-10-09 10:47:58 +08:00
infrastructure fix(chunker): respect Markdown fences during heading detection 2026-10-08 21:06:59 +08:00
ipclass fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
localsandbox feat(lite): install and run skills on the host (#3661) 2026-09-24 21:30:34 +08:00
logger fix(logger): keep LLM debug records inside their directory 2026-09-25 18:22:14 +08:00
mcp fix(mcp): pass embedded resources in tool results to the agent (#3766) 2026-10-08 01:25:04 +08:00
mcpserver fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
middleware fix(middleware): stop buffering whole request bodies in the access log (#3927) 2026-10-08 01:29:05 +08:00
modelcontext fix(chat): 在模型上下文中标注 FILTER_TOP_K 的子集截断,避免把前 N 条当作全集作答 (#3758) 2026-10-09 10:54:37 +08:00
models feat: index and recall images with multimodal embedding models (#3683) 2026-10-08 18:19:53 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
reranking fix(retrieval): fix recall correctness, score scales, cost and agent tools (#3687) 2026-09-25 10:48:18 +08:00
router fix(frontend): 修复复制模型时模型名称被改写的问题 (#3830) 2026-09-29 19:32:08 +08:00
runtime fix(server): run ResourceCleaner on signal shutdown instead of racing Fatalf exit (#3804) 2026-09-28 23:37:36 +08:00
sandbox fix(sandbox): reclassify exec races with the idle sweep as NotFound so rebinding heals (#3980) 2026-10-08 01:28:53 +08:00
searchutil feat: index and recall images with multimodal embedding models (#3683) 2026-10-08 18:19:53 +08:00
sourceloc fix(citations): 修复原文定位、高亮范围与 DocReader 启动失败 (#3794) 2026-09-27 20:32:26 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
stream feat(session): in-place rewind with workspace checkpoint reset (#3469) 2026-09-20 21:01:00 +08:00
textconv fix: remove GPL converter and bundle third-party license sources 2026-09-08 15:19:10 +08:00
tracing/langfuse fix(milvus): preserve keyword retrieval scores 2026-09-17 11:59:40 +08:00
types fix(wiki): 唯一写出口 UpdatePage 拦住丢表格行的机器重写(agent 整页写入不再静默改短页面) (#3793) 2026-10-09 10:55:28 +08:00
utils feat(datasource): add Seafile data source connector (#3616) 2026-10-08 16:18:09 +08:00