Merge remote-tracking branch 'origin/master' into worktree/process-plugin-streaming-72f9b3
# Conflicts: # docs/event-producer-consumer.i18n.yaml # docs/event-producer-consumer.md # docs/event-producer-consumer.zh.md # docs/module-graph.i18n.yaml # docs/module-graph.md # docs/module-graph.zh.md # packages/api/remotes/package.json # packages/api/remotes/src/client/index.ts # packages/api/session-controller/README.i18n.yaml # packages/api/session-controller/README.md # packages/api/session-controller/README.zh.md # packages/api/session-controller/tsconfig.host.json # packages/client/ui-approval/src/client/contract/slots.ts # packages/client/ui-chat/src/client/chat/MessageItem.tsx # packages/client/ui-chat/src/client/conversation-nodes/assistant.ts # packages/client/ui-chat/src/client/conversation-nodes/partial.ts # packages/client/ui-chat/src/client/conversation-nodes/tool.ts # packages/client/ui-chat/src/client/model/tool-call-tree.ts
This commit is contained in:
commit
d3b1f2d1bc
461 files changed
+12176
-1942
No files matched your search
@@ -73,21 +73,29 @@ describe('Session queue snapshot intake', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('marks mixed-content messages non-editable and keeps image blocks out of the text preview', () => {
|
||||
it('marks mixed-content messages non-editable and keeps attachment blocks out of the text preview', () => {
|
||||
const session = makeSession()
|
||||
session.handleControlFrame(queueFrame([{
|
||||
id: 'q-image',
|
||||
body: '',
|
||||
content: [{ type: 'text', text: 'hi' }, { type: 'image', data: 'x' } as never],
|
||||
content: [
|
||||
{ type: 'text', text: 'hi' },
|
||||
{ type: 'image', data: 'x' } as never,
|
||||
{ type: 'file', attachment: { attachmentId: 'file-1', name: 'notes.txt', bytes: 5 } } as never,
|
||||
],
|
||||
}]))
|
||||
const queue = session.getSnapshot().queue
|
||||
expect(typeof queue[0]?.messageId).toBe('string')
|
||||
expect(queue).toMatchObject([
|
||||
{
|
||||
id: 'q-image', placement: 'queued',
|
||||
content: [{ type: 'text', text: 'hi' }, { type: 'image', data: 'x' }],
|
||||
// Image blocks render as thumbnails from `content`, so the preview
|
||||
// carries only the text; non-image foreign blocks keep their marker.
|
||||
content: [
|
||||
{ type: 'text', text: 'hi' },
|
||||
{ type: 'image', data: 'x' },
|
||||
{ type: 'file', attachment: { attachmentId: 'file-1', name: 'notes.txt', bytes: 5 } },
|
||||
],
|
||||
// Attachment blocks render from `content`, so the preview carries
|
||||
// only text; other foreign blocks keep their marker.
|
||||
preview: 'hi', text: null,
|
||||
},
|
||||
])
|
||||
|
||||
Reference in new issue
Block a user