File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
apps/code/src/renderer/utils Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -182,14 +182,16 @@ export function extractUserPromptsFromEvents(events: AcpMessage[]): string[] {
182182 if ( isJsonRpcRequest ( msg ) && msg . method === "session/prompt" ) {
183183 const params = msg . params as { prompt ?: ContentBlock [ ] } ;
184184 if ( params ?. prompt ?. length ) {
185- // Find first visible text block (skip hidden context blocks)
186- const textBlock = params . prompt . find ( ( b ) => {
187- if ( b . type !== "text" ) return false ;
188- const meta = ( b as { _meta ?: { ui ?: { hidden ?: boolean } } } ) . _meta ;
189- return ! meta ?. ui ?. hidden ;
190- } ) ;
191- if ( textBlock && textBlock . type === "text" ) {
192- prompts . push ( textBlock . text ) ;
185+ const { text, attachments } = extractPromptDisplayContent (
186+ params . prompt ,
187+ { filterHidden : true } ,
188+ ) ;
189+
190+ if ( text ) {
191+ prompts . push ( text ) ;
192+ } else if ( attachments . length > 0 ) {
193+ const labels = attachments . map ( ( a ) => a . label ) . join ( ", " ) ;
194+ prompts . push ( `[Attached files: ${ labels } ]` ) ;
193195 }
194196 }
195197 }
You can’t perform that action at this time.
0 commit comments