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.
22 lines
1.5 KiB
Markdown
22 lines
1.5 KiB
Markdown
# @deepseek-ai/dsh-attachment
|
|
|
|
English | [中文](README.zh.md)
|
|
|
|
The durable attachment seam. `ctx.attachments` validates and atomically commits immutable image bytes, then returns a serializable `ImageAttachmentRef`; consumers never persist browser paths, object URLs, provider URLs, or base64 in session events.
|
|
|
|
Unsent composer images remain browser-owned temporary drafts. `validateImage` runs the same admission policy without persisting; batch writers validate every member first so a malformed member cannot strand earlier members as unreferenced objects. `saveImage` commits each accepted image before any model-visible session event is published, and `readImage` verifies the content-addressed object against its logged metadata. Callers may cancel `readImage`; implementations observe cancellation around backend and verification work and preserve it instead of translating it into a storage failure.
|
|
|
|
## Model Experience
|
|
|
|
Indirectly, through the role-neutral core `ImageBlock` and provider adapters that resolve its durable reference.
|
|
|
|
#### KV Cache effect
|
|
|
|
Adding an image changes the provider request and therefore invalidates the affected request suffix.
|
|
|
|
## Known Limitations and Deferred Work
|
|
|
|
- Version one accepts PNG, JPEG, WebP, and GIF only.
|
|
- Retention and garbage collection are deferred because resumed and forked sessions may share immutable objects.
|
|
- Generic files, audio, video, and persistent unsent drafts require separate lifecycle and provider contracts.
|