Go to file
caoqianming 011aee1334 fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38)
task 7f904e5f 复盘:定时任务/企业微信推送写进 DB 的 assistant 消息把产物
文件写成完整下载 API 链接 [名](/v1/files/download?path=<rel>),web 正文链接
拦截器(chat.js 的 .msg .body a[href] click)注释设定是"user_root 相对路径",
于是把整个 /v1/files/download?path=... URL 当相对 rel,去前导 / 后
rel=v1/files/download?path=scheduled-…txt,再塞进 openFilePreview 二次包进
download URL → 请求 path 不存在 → 404(node 复刻拦截器坐实)。

关键调研(纠了初判):一度以为链接得留完整 URL 给企业微信端点下载、改格式会
break wecom——错。push_wecom(service.py:266)企业微信端走 send_text(摘要)+
send_file(文件附件独立通道),压根不碰这个 markdown 链接;_build_push_message
的链接只进 DB 给 web 端渲染。焊死 /v1/files/download?path= 纯属把具体 API
端点这个渲染细节泄漏进数据层,还正好踩拦截器坑。

修(A+B 互补):
- B 源头(分层正解):core/wechat/service.py::_build_push_message 链接改
  user_root 相对路径 [名]({rel}),与 chip/正文相对链接统一契约、走拦截器
  已有相对分支;docstring 记明为何不用绝对 API URL(防后人再焊)。
- A 前端兜底:chat.js 拦截器在相对路径回退前先判 ^/?v1/files/,命中则
  new URL(raw,origin).searchParams.get("path") 抽真正 rel 交 openFilePreview
  (自动解码,txt/docx 复用同 modal)——救 DB 里已存 20+ 条历史简报(改不了)
  + 健壮兜底。

验证:node 复刻拦截器——B 新格式(相对)与 A 历史(完整 URL)都解析成同一
干净 rel;A 另测 URL 编码含空格#号 path / 普通相对 / ./ 前缀 / 外链全对、
外链仍开新标签;node --check chat.js + ast.parse service.py 通过。web 前端
需刷新页面生效。additive,不碰对外 API/DB/企业微信推送(send_file)契约,
仅 DB 内 assistant 文本链接写法由绝对 API URL 收敛为相对 rel。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 22:38:57 +08:00
config fix(sandbox): pids-limit 256→1024 修容器内 mermaid 渲染必崩(bump 0.58.2) 2026-07-11 09:02:45 +08:00
core fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38) 2026-07-17 22:38:57 +08:00
db/migrations feat(context): §8.8 Phase 2 长会话中段折叠摘要 + 头部压缩指示环(bump 0.54.1) 2026-07-09 12:39:31 +08:00
deploy feat(sandbox): 镜像补 file 命令(bump 0.58.12) 2026-07-13 08:50:55 +08:00
docs docs: 操作说明书精简版表格微调 + 新增「科研AI双智能体·汇报PPT大纲」+ bump 0.24.4 2026-06-24 14:57:57 +08:00
prompts/system docs(prompt): system prompt 加通用 context 纪律,堵大块输出滚雪球(bump 0.32.5) 2026-06-29 14:56:44 +08:00
rendering fix(rendering+chip): 修 task d9c74a5a 三处独立缺陷——chip 粗体路径 404 / docx emoji 缺字 / 单文件被迫建 sections(bump 0.58.37) 2026-07-17 22:15:34 +08:00
scripts fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38) 2026-07-17 22:38:57 +08:00
skills feat(mp): mp_search_summary 批量入参 formulas[] 定点解检索烧 token(bump 0.58.28) 2026-07-15 10:49:35 +08:00
tests fix(run_python): 超时返回超时前的部分输出 + 无缓冲(-u),模型据此续跑不整批重来(bump 0.58.36) 2026-07-17 10:53:14 +08:00
tools fix(run_python): 超时返回超时前的部分输出 + 无缓冲(-u),模型据此续跑不整批重来(bump 0.58.36) 2026-07-17 10:53:14 +08:00
web fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38) 2026-07-17 22:38:57 +08:00
.gitattributes Add .gitattributes: force LF for shell + Dockerfile 2026-05-26 10:45:17 +08:00
.gitignore feat: 忽略vscodecounter 2026-07-07 15:38:55 +08:00
CHANGELOG.md fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38) 2026-07-17 22:38:57 +08:00
CLAUDE.md feat(changelog): 用户版更新日志 CHANGELOG.md + /v1/changelog + 点版本号弹层(bump 0.55.0) 2026-07-09 16:49:26 +08:00
DESIGN.md feat(rendering): 通用报告走平台渲染器 report profile + 基座引导,少让模型手撸 python-docx(bump 0.58.35) 2026-07-17 09:32:02 +08:00
DOCUMENT_SEARCH_API.md feat(skill): documents skill 接内部材料学科知识库(document_search API) 2026-05-21 15:31:21 +08:00
EMBED.md feat(wecom): 企业微信应用主页免登进 embed 控制台(bump 0.44.0) 2026-07-07 10:09:52 +08:00
PROGRESS.md fix(channel-push): 定时简报产物文件链接点开 404——推送端收敛为相对 rel + 前端识别完整 URL 兜底历史(bump 0.58.38) 2026-07-17 22:38:57 +08:00
RUN.md feat(ops+web): run 级错误持久提示+失败聚集+provider 致命错误即时告警(bump 0.58.21) 2026-07-13 14:06:29 +08:00
SCIENTIFIC_SKILLS.md skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00
SKILL_LIST.md feat(prompt): 结构图 mermaid vs 生图改 ask_user 让用户点选(bump 0.58.15) 2026-07-13 10:18:48 +08:00
WW_verify_THssshZfneJwIG5Y.txt chore(wecom): 加企业微信可信域名校验文件 WW_verify_THssshZfneJwIG5Y.txt(放 repo 根)+ bump 0.26.7 2026-06-25 10:25:06 +08:00
alembic.ini core(§7 B Step 1): Storage 基建 — SQLAlchemy ORM + alembic + db CLI 2026-05-14 10:41:44 +08:00
main.py feat(web): main.py web 支持 --ssl-certfile/--ssl-keyfile(uvicorn 原生 TLS,免 nginx)+ bump 0.26.8 2026-06-25 10:43:18 +08:00
requirements.txt feat(sandbox): 补 olefile/xlrd/extract-msg 老格式解析依赖(bump 0.58.23) 2026-07-15 08:16:18 +08:00