WeKnora/internal
yetuge a75e8e9ac0
fix(datasource): 语雀/Notion/IMA/飞书连接器 API 响应体补体积上限 (#3985)
* fix(datasource): 语雀/Notion/IMA/飞书 API 响应体补体积上限

#3887 给 GitLab 客户端补了 readCapped 上限;语雀、Notion、IMA、飞书四个
连接器的 API 读取仍是裸 io.ReadAll,破损或恶意端点可让同步进程缓冲无界
响应体。各连接器比照 GitLab 同步同一上限(16 MiB)与显式超限报错,limit
做成字段以便测试下调。飞书 429/5xx 错误路径的 best-effort 读取刻意不动。

* fix(datasource): 响应体上限为零值时回退到默认 16 MiB

测试里直接用字面量构造的 Client 不经过 NewClient,jsonLimit 为 0,
readCapped 会拒绝任何响应,导致 feishu/core 11 个现有测试失败。
readCapped 遇到非正数 limit 时改用 maxJSONResponseBytes。

* fix(datasource): 响应体超限不再重试;补齐飞书 token 与下载错误分支的读取上限

- yuque/ima/feishu/notion 的 readCapped 改用哨兵错误 errResponseTooLarge,
  文案不变;yuque doRequest、ima callAPIAt、feishu DoRequest 遇到超限直接返回,
  不再按退避重试 3 次(同一请求必然再次超限,只会白耗限流额度)。
- 飞书 GetTenantAccessToken 改为 readCapped + json.Unmarshal,和其他 API 响应同一上限。
- 飞书 downloadRawBytes 的 429/5xx/非 200 错误预览只读 4 KiB,
  download failed 错误不再携带完整响应体。

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-08 14:02:29 +08:00
..
agent fix(agent): preserve untouched numeric tool arguments during casting (#3936) 2026-10-08 13:14:18 +08:00
application fix(knowledge): delete written chunks when the storage quota check fails (#3656) 2026-10-08 13:14:10 +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 fix: use consistent qdrant env settings (#3960) 2026-10-07 23:59:56 +08:00
database revert: take the plugin system back out of main 2026-09-26 14:58:18 +08:00
datasource fix(datasource): 语雀/Notion/IMA/飞书连接器 API 响应体补体积上限 (#3985) 2026-10-08 14:02:29 +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(docs): make `make docs` reproduce the committed Swagger again (#3751) 2026-10-08 01:26:08 +08:00
im fix(im/wecom): preserve image in mixed messages with text captions (#3901) 2026-10-08 01:25:25 +08:00
infrastructure fix(docparser): anydoc 内嵌 EMF/WMF 图片的扩展名与 Rust 侧对齐 (#3938) 2026-10-08 01:21:57 +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(agent): 图谱查询的三处截断必须可见,模型不再把子图当全集 (#3885) 2026-10-07 23:59:50 +08:00
models fix(models): honor OpenRouter native thinking for legacy defaults (#3807) 2026-10-08 01:22:04 +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(wiki): 增加跨知识库 Wiki 搜索 POST /wiki-search (#3535) 2026-09-25 22:22:58 +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): 重建链接逐页写失败不再静默,半成品不再回 200 (#3884) 2026-10-08 01:25:53 +08:00
utils fix(multimodal): bound remote image downloads by the file size limit (#3906) 2026-10-08 13:14:04 +08:00