fix: preserve multi-image prompt batches

This commit is contained in:
Tianyi Cui
2026-07-30 00:58:35 +08:00
parent 60c8f5ea69
commit 6312e43a11
35 changed files with 336 additions and 149 deletions

View File

@@ -250,10 +250,16 @@ describe('PiAiAdapter provider routing', () => {
class LateAttachmentStore extends AttachmentStore {
readonly imageLimits: ImageAttachmentLimits = {
maxImageBytes: 1,
maxImagesPerMessage: 1,
maxMessageImageBytes: 1,
maxImagePixels: 1,
mediaTypes: ['image/png'],
}
validateImage(_input: SaveImageAttachment): void {
throw new Error('not used')
}
saveImage(_input: SaveImageAttachment): Promise<ImageAttachmentRef> {
return Promise.reject(new Error('not used'))
}

View File

@@ -68,10 +68,16 @@ async function harness(image?: StoredImageAttachment): Promise<Context> {
class E2eAttachmentStore extends AttachmentStore {
readonly imageLimits: ImageAttachmentLimits = {
maxImageBytes: fixture.data.byteLength,
maxImagesPerMessage: 1,
maxMessageImageBytes: fixture.data.byteLength,
maxImagePixels: fixture.ref.width * fixture.ref.height,
mediaTypes: [fixture.ref.mediaType],
}
validateImage(_input: SaveImageAttachment): void {
throw new Error('e2e attachment fixture is read-only')
}
saveImage(_input: SaveImageAttachment): Promise<ImageAttachmentRef> {
return Promise.reject(new Error('e2e attachment fixture is read-only'))
}