mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
Response-consumer cancellation already stopped lineage reads, persistence reads, and ZIP production, but the final attachment phase called readImage without the producer signal. A slow or stalled attachment backend could therefore keep working after the browser abandoned the download and prevent the producer from settling.\n\nExtend the attachment read seam with optional cancellation, forward it through the local backend into Node's filesystem read, and preserve the abort reason rather than wrapping it as a storage failure. The exporter now passes its combined request/consumer signal to every attachment read.\n\nCover both ownership boundaries: the local-store test proves filesystem forwarding and cancellation identity, while the assembled export test cancels a reader during a pending attachment provider call. Regenerate the Cordis API catalog and paired documentation so implementers can rely on the new contract.
1.4 KiB
1.4 KiB
@deepseek-ai/dsh-attachment
English | 中文
持久附件服务边界。ctx.attachments 校验并以原子方式提交不可变图片字节,随后返回可序列化的 ImageAttachmentRef;消费方绝不会在会话事件中持久保存浏览器路径、对象 URL、提供方 URL 或 base64。
未发送的输入区图片仍是由浏览器持有的临时草稿。validateImage 运行相同的准入策略,但不执行持久化;批量写入方会先校验每个成员,避免某个格式错误的成员使较早的成员成为无引用对象。saveImage 会在发布任何模型可见的会话事件前提交每张已接受的图片,readImage 则根据已记录的元数据校验内容寻址对象。调用方可以取消 readImage;实现会在后端读取与校验工作的边界观察取消,并保留取消语义,而不会将其转换为存储失败。
模型体验
该包通过角色无关的核心 ImageBlock,以及解析其持久引用的提供方适配器,间接影响模型。
KV 缓存影响
添加图片会改变提供方请求,因此会使受影响的请求后缀失效。
已知限制与待完成工作
- 第一版仅接受 PNG、JPEG、WebP 和 GIF。
- 保留策略与垃圾回收尚未实现,因为恢复和 fork 后的会话可能共享不可变对象。
- 通用文件、音频、视频和持久的未发送草稿需要单独的生命周期与提供方契约。