Repository navigation
Conversation
|
Thanks for the fix. I checked the multi-image case against I called the real
The numbers above are the indices in This confirms the index fix with two source images and checks that it leaves uploads, size redaction, and image hiding intact. If you'd like to extend the regression here, the extra assertions are that |
|
Thanks @ningsiyuan1024 for the independent verification with real I'll add the two suggested assertions to the regression so the test pins not only the first slot's shift but also that |
|
Pushed the suggested assertions in a test-only commit ( Verification note: this workspace has no installed JS dependencies for this package and no network, so I could not run |
Fixes #4375
images.editpasses the source image and mask as one flat upload list.getInputImageAttributes()compacts indices whenever an upload cannot be read, so when the source is an async iterable (or exceedsbase64ImageMaxLength) the readable mask shifts to index 0 and is emitted asinput.images.0.image.url— it becomes the source image.Fix
Added an opt-in
preserveIndicesoption togetInputImageAttributes()that reserves a slot for unreadable uploads. It is enabled only for theimages.editpath; all other callers keep the existing contiguous-index behavior. Added a patch changeset.Verification
expected 'data:image/png;base64,...' to be undefinedatinput.images.0; with fix mask is atinput.images.1and index 0 is absent.type:check,oxlint,oxfmt --checkand build all clean.No real API calls or credentials (all
openai.postcalls mocked). Only pinned SDK/Node versions tested.