fix: harden Web image admission

This commit is contained in:
Tianyi Cui
2026-07-30 01:58:36 +08:00
parent d6c82001b3
commit 515d48875e
52 changed files with 999 additions and 444 deletions
+8 -4
View File
@@ -256,8 +256,8 @@ describe('PiAiAdapter provider routing', () => {
mediaTypes: ['image/png'],
}
validateImage(_input: SaveImageAttachment): void {
throw new Error('not used')
validateImage(_input: SaveImageAttachment): Promise<void> {
return Promise.reject(new Error('not used'))
}
saveImage(_input: SaveImageAttachment): Promise<ImageAttachmentRef> {
@@ -613,8 +613,12 @@ describe('provider profile lifecycle', () => {
messages: [createUserMessage({
content: [{
type: 'tool-result',
toolCallId: 'call-image' as never,
content: [{ type: 'image', attachment: IMAGE_REF }],
toolCallId: 'call-outer' as never,
content: [{
type: 'tool-result',
toolCallId: 'call-inner' as never,
content: [{ type: 'image', attachment: IMAGE_REF }],
}],
}],
source: { kind: 'plugin', plugin: 'test' },
})],