Repository navigation
feat(im): 入站音视频交给模型,个人 IM 附件统一受管存放 - #5779
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 536424efed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
- video / video_note / voice / audio 与 video/*、audio/* 文档不再标 unsupported, 20MB 以内按文件下载(file block 路径),超出标 oversize - TelegramIM 内存记下群媒体 file_id(200 条 / 24h,受保护群不入池, 已随本轮送达的出池),群上下文实际纳入的消息附件经 contextAttachments 只进模型、不落库;名额与飞书同口径,先占名额再下载,全响应轮次不补 - groupWindowCore 组装结果附带 messageIds;能力台账登记 2j Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
- 音视频经 host.media.cacheMedia 入 cindy-media(可回收暂存,消息落库时转为附件引用) - host 未提供 cacheMedia 或总仓拒收格式时标 video/audio 不支持,不降级写 legacy 目录 - 下载期间配置换代时回滚本次暂存的媒体 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
- 新增 IMHost.files:非媒体文件按账号暂存到 im-attachments/<渠道>/staging, turnRunner 在任务确定后移入 im-attachments/<渠道>/sessions/<任务ID>, 任务删除时统一清理(含微信),无人认领的暂存文件 24h 后清理 - 飞书、Discord、Telegram、企业微信:图片与音视频走 host.media,其余文件走 host.files;能力缺失或总仓拒收格式时标不支持,不再回落写 cc-agent/*-media - 飞书视频消息、Discord 音视频改为下载后交给模型(进媒体总仓) - 移除飞书 mediaStore.getOrDownload 旧目录缓存;更新媒体规则与能力台账 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
536424e to
f16babf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f16babf8ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d532347c09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 330822805c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfe822286b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
收敛检查点(第 5 轮):入站附件不变量第 1–5 轮的 review 反馈归为三族。下面每族一条不变量,本 PR 的实现与测试以此为准;之后同族的反馈对照这里判断。 I1 分类:单一判据
图片和音视频收不收,由总仓的白名单和真实字节决定;拒收或 host 缺对应能力时标不支持,不回落文件暂存,也不写 I2 回滚:落库前的写入都可撤销
I3 归属:任务目录只放落库消息引用的文件
本 PR 不处理(已接受的边界)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c1533eb97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
收敛检查点补充(第 6 轮)第 6 轮的 4 条反馈都已对照前面的不变量收口(提交 c2afc7e):
新增划定的边界(本 PR 不处理):飞书下载完成后, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2afc7e19f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f48381b14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 5f48381b14
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac43a3666d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85d373319f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5743f5d132
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7030a370f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
边界补充(第 12 轮)以下两条为本 PR 明确不处理的罕见交错,修复它们都需要新增机制(排队期间的临时引用、暂存续租或队列登记)。如有需要另开 issue:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 927aefb8b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
边界补充(第 13 轮):如果删除请求在等待 DB 写入或共享任务清理期间恰好切换了账号,发起删除的账号的 IM 附件目录可能残留。这只会多占该账号自己的磁盘,不会误删数据,也不会跨账号暴露数据。本 PR 不为此把原始账号的作用域透传到所有删除入口。 |
|
边界补充(维护者决定,2026-10-12):群历史附件与群聊文本、引用附件采用同一信任模型。群友的媒体或文件可能被带进主人触发的轮次。非 Full access 时,群轮次照旧走逐轮强确认;Full access 是主人对该任务的明确授权,本 PR 不另做隔离。 |
这次改了什么
摘要
Telegram 群里发的视频没有交给 bot:入站代码把视频、语音、音频一律标成“不支持”;群里“先发视频、再单独 @bot”时,群记录只存文件名,触发时也拿不到附件。
本 PR 修复这个问题,并把所有个人 IM 渠道的入站附件统一改为受管存放,不再写冻结的
cc-agent/*-media目录(docs/dev-rules/media-storage-and-protocols.md:该目录是只读的历史兼容层):video/*、audio/*文档,20MB 以内(Bot API 上限)下载后经host.media.cacheMedia进 cindy-media,以 file block(可读路径)交给模型;超限或格式不收时作为未提供原因告知模型。TelegramIM在内存里记下群媒体的 file_id(200 条 / 24 小时,重启清空;受保护群不记;不随轮次出池,已受理轮次由群窗口游标防重复,同一轮已随附件送达的相册成员与被引消息排除)。触发时只补这一轮群上下文实际纳入那些消息的附件(groupWindowCore组装结果新增messageIds),名额与飞书群上下文一致(图片 6、文件 4,最新优先,先占名额再下载),经contextAttachments只进模型、不落库;全响应(ambient)轮次不补。IMHost.files。transport 把 PDF / docx / zip 等暂存到按账号隔离的im-attachments/<渠道>/staging/,turnRunner在任务确定后、交给模型和落库之前,移入im-attachments/<渠道>/sessions/<任务ID>/(与微信既有目录同一棵树)。任务删除时统一清理所有渠道的附件目录(含微信,并补上updateSessionInDb/setSessionsStatusInDb路径漏清的情况);无人认领的暂存文件 24 小时后清理。实现见apps/desktop/src/main/im/shared/inboundFileStaging.ts。host.media,其余文件走host.files;能力缺失或总仓拒收格式时标为不支持,不再回落写旧目录。飞书视频消息、Discord 音视频顺带改为下载后交给模型。移除飞书mediaStore.getOrDownload旧目录缓存。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
cc-agent,所有个人 IM 渠道一并更新。cc-agent下历史文件的清理(规则禁止新增该目录删除能力)。cc-agent的路径保持可读;IMHost.paths.*MediaDir保留为只读兼容字段。UI 变化
不涉及。
怎么验证的
自动验证
第 1 轮 review 收敛(f16babf8e,已 rebase 到 main 7c4ba33)后复跑:
CI「Linux unit tests (2/2)」唯一失败
src/renderer/__tests__/remoteAgentRelocationWiring.test.ts(ModelSelector 改道行带所属电脑)是 main 基线问题:本 PR 未改 renderer,rebase 到 main 7c4ba33 后在本地同样失败,来自 main 近期 provider-group 提交,本 PR 不修。手工验证
未在真实 IM 中实测(见下)。
未执行的验证
cc-agent/*-media不再新增文件。风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)