Skip to content

The agent that grows with you

Merge origin/main (#12: 9 commits to bac0c45d859) into feat/unified-gateway-runtime

teknium15614927419c7
diff --cc apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
index a8421b10826,e0dc5e30968..a358ed5e38b
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
@@@ -5,9 -5,9 +5,10 @@@ import { stripAnsi } from '@hermes/shar
import { useStore } from '@nanostores/react'
import { type MutableRefObject, useCallback, useEffect, useRef } from 'react'
+import { hermesApi } from '@/api/client'
import { transcribeAudio } from '@/hermes'
import { useI18n } from '@/i18n'
+ import { attachmentPathNeedsUpload } from '@/lib/attachment-upload-policy'
import { type ChatMessage, textPart } from '@/lib/chat-messages'
import { pathLabel } from '@/lib/chat-runtime'
import { sanitizeComposerInput } from '@/lib/composer-input-sanitize'
diff --cc apps/desktop/src/lib/chat-messages/hydration.ts
index 27fa5e25fe4,04fa5744375..6447bec775f
--- a/apps/desktop/src/lib/chat-messages/hydration.ts
+++ b/apps/desktop/src/lib/chat-messages/hydration.ts
@@@ -1,6 -1,6 +1,7 @@@
import { skillInvocationText } from '@hermes/shared'
+import { formatRefValue } from '@/components/assistant-ui/directive-text'
+ import { splitLeadingAttachmentRefs } from '@/components/assistant-ui/reference-kinds'
import { extractImageRefs } from '@/lib/embedded-images'
import { dedupeGeneratedImageEchoesInParts } from '@/lib/generated-images'
import { isTodoToolName } from '@/lib/todos'
@@@ -449,10 -435,13 +450,13 @@@ export function toChatMessages(messages
// thumbnail pushes any caption text below the clamp's visible area — so
// pull image refs out into `attachmentRefs` (same shape the local
// optimistic composer already uses) and render them via the dedicated
- // attachments row below the bubble instead.
+ // attachments row below the bubble instead. The leading `@file:` block
+ // (attached files, large pastes) moves there too, for the same parity.
- const imageRefExtraction = displayRole === 'user' && rawDisplayContent ? extractImageRefs(rawDisplayContent) : null
+ const imageRefExtraction = displayRole === 'user' && rawDisplayContent ? persistedImageRefs(rawDisplayContent) : null
- const displayContent = imageRefExtraction ? imageRefExtraction.cleanedText : rawDisplayContent
- const extractedAttachmentRefs = imageRefExtraction?.refs.length ? imageRefExtraction.refs : undefined
+ const fileRefExtraction = imageRefExtraction ? splitLeadingAttachmentRefs(imageRefExtraction.cleanedText) : null
+ const displayContent = fileRefExtraction ? fileRefExtraction.text : rawDisplayContent
+ const liftedRefs = [...(fileRefExtraction?.refs ?? []), ...(imageRefExtraction?.refs ?? [])]
+ const extractedAttachmentRefs = liftedRefs.length ? liftedRefs : undefined
const parts: ChatMessagePart[] = []
const rowId = message.row_id ?? (typeof message.id === 'number' ? message.id : undefined)