mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 08:03:58 +00:00
fix(native-chat): keep consecutive image frames bare
This commit is contained in:
@@ -374,7 +374,7 @@ describe('sendNativeChatMessageWithImageAttachments', () => {
|
||||
|
||||
expectWriteOrder(sendRuntimePtyInput.mock.calls, [
|
||||
NATIVE_CHAT_CLEAR_UNSUBMITTED_INPUT,
|
||||
'\x1b[200~/tmp/a.png\x1b[201~ ',
|
||||
'\x1b[200~/tmp/a.png\x1b[201~',
|
||||
'\x1b[200~/tmp/b.png\x1b[201~ '
|
||||
])
|
||||
})
|
||||
|
||||
@@ -25,10 +25,10 @@ describe('joinImagePastesAndPrompt', () => {
|
||||
expect(joinImagePastesAndPrompt([], PROMPT)).toBe(PROMPT)
|
||||
})
|
||||
|
||||
it('separates multiple attachments from each other and from the prompt', () => {
|
||||
it('keeps back-to-back image frames bare and separates only the final frame from prompt text', () => {
|
||||
expect(joinImagePastesAndPrompt([IMAGE_A, IMAGE_B], PROMPT)).toBe(
|
||||
`${IMAGE_A} ${IMAGE_B} ${PROMPT}`
|
||||
`${IMAGE_A}${IMAGE_B} ${PROMPT}`
|
||||
)
|
||||
expect(joinImagePastesAndPrompt([IMAGE_A, IMAGE_B], '')).toBe(`${IMAGE_A} ${IMAGE_B}`)
|
||||
expect(joinImagePastesAndPrompt([IMAGE_A, IMAGE_B], '')).toBe(`${IMAGE_A}${IMAGE_B}`)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -19,7 +19,7 @@ export function imagePasteWritesFollowedByText(
|
||||
return framedImagePastes.map((paste, index) =>
|
||||
separateImagePasteFromFollowingText(
|
||||
paste,
|
||||
index < framedImagePastes.length - 1 || followedByText
|
||||
index === framedImagePastes.length - 1 && followedByText
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user