The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(tui): stop announcing attachments outside the composer
Brooklyn Nicholson22af266b4f3b
diff --git a/ui-tui/src/app/submissionCore.ts b/ui-tui/src/app/submissionCore.tsindex c99eca09f2e..aa6cd98db6c 100644--- a/ui-tui/src/app/submissionCore.ts+++ b/ui-tui/src/app/submissionCore.ts@@ -1,4 +1,3 @@-import { attachedImageNotice } from '../domain/messages.js'import type { GatewayClient } from '../gatewayClient.js'import type { InputDetectDropResponse, PromptSubmitResponse } from '../gatewayTypes.js'import type { Msg } from '../types.js'@@ -109,6 +108,11 @@ export function submitPrompt(// Always ask the backend whether this looks like a file drop. The backend's// _detect_file_drop handles paths with spaces, quotes, Windows drive letters,// and escaped characters correctly.+ //+ // No notice is emitted for a match: an image dropped into the composer already+ // shows as an `[[ Image N ]]` token, and a matched non-image path is rewritten+ // in place. Announcing it a second time above the status bar was the old+ // out-of-band attachment UI.deps.gw.request<InputDetectDropResponse>('input.detect_drop', { session_id: sid, text }).then(r => {@@ -116,12 +120,6 @@ export function submitPrompt(return startSubmit(text, deps.expand(text), showUserMessage)}- if (r.is_image) {- turnController.pushActivity(attachedImageNotice(r))- } else {- turnController.pushActivity(`detected file: ${r.name}`)- }-startSubmit(r.text || text, deps.expand(r.text || text), showUserMessage)}).catch(() => startSubmit(text, deps.expand(text), showUserMessage))diff --git a/ui-tui/src/domain/messages.ts b/ui-tui/src/domain/messages.tsindex 45fbf606c0b..b4428520d81 100644--- a/ui-tui/src/domain/messages.ts+++ b/ui-tui/src/domain/messages.ts@@ -1,24 +1,9 @@import { LONG_MSG } from '../config/limits.js'-import { buildToolTrailLine, fmtK } from '../lib/text.js'+import { buildToolTrailLine } from '../lib/text.js'import type { Msg, SessionInfo } from '../types.js'export const introMsg = (info: SessionInfo): Msg => ({ info, kind: 'intro', role: 'system', text: '' })-export const imageTokenMeta = (info?: ImageMeta | null) => {- const { width, height, token_estimate: t } = info ?? {}-- return [width && height ? `${width}x${height}` : '', (t ?? 0) > 0 ? `~${fmtK(t!)} tok` : '']- .filter(Boolean)- .join(' · ')-}--export const attachedImageNotice = (info?: ({ name?: string } & ImageMeta) | null) => {- const meta = imageTokenMeta(info)- const label = info?.name ? `📎 Attached image: ${info.name}` : '📎 Attached image'-- return `${label}${meta ? ` · ${meta}` : ''}`-}-export const userDisplay = (text: string) => {if (text.length <= LONG_MSG) {return text@@ -112,12 +97,6 @@ export const fmtDuration = (ms: number) => {return h > 0 ? `${h}h ${m}m` : m > 0 ? `${m}m ${s}s` : `${s}s`}-interface ImageMeta {- height?: number- token_estimate?: number- width?: number-}-interface TranscriptRow {context?: stringdisplay_kind?: string