@@ -21,7 +21,7 @@ export function AssistantMessage({
2121 < div className = {
2222 cn (
2323 "bg-bytebot-bronze-light-3 flex items-start justify-start gap-2 px-4 py-3 border-x border-bytebot-bronze-light-7" ,
24- ! [ TaskStatus . RUNNING , TaskStatus . NEEDS_HELP ] . includes ( taskStatus ) && "border-b border-bytebot-bronze-light-7 rounded-b-lg"
24+ ! [ TaskStatus . RUNNING , TaskStatus . NEEDS_HELP ] . includes ( taskStatus ) && ! group . take_over && "border-b border-bytebot-bronze-light-7 rounded-b-lg"
2525 ) }
2626 >
2727 < MessageAvatar role = { group . role } />
@@ -52,13 +52,16 @@ export function AssistantMessage({
5252 block . content &&
5353 block . content . length > 0
5454 ) {
55- block . content . map ( ( contentBlock ) => {
56- if ( isImageContentBlock ( contentBlock ) ) {
57- return (
55+ // Check ALL content items in the tool result, not just the first one
56+ const markers : React . ReactNode [ ] = [ ] ;
57+ block . content . forEach ( ( contentItem , contentIndex ) => {
58+ if ( isImageContentBlock ( contentItem ) ) {
59+ markers . push (
5860 < div
59- key = { blockIndex }
61+ key = { ` ${ blockIndex } - ${ contentIndex } ` }
6062 data-message-index = { messageIdToIndex [ message . id ] }
6163 data-block-index = { blockIndex }
64+ data-content-index = { contentIndex }
6265 style = { {
6366 position : "absolute" ,
6467 width : 0 ,
@@ -69,6 +72,7 @@ export function AssistantMessage({
6972 ) ;
7073 }
7174 } ) ;
75+ return markers ;
7276 }
7377 return null ;
7478 } ) }
@@ -95,22 +99,27 @@ export function AssistantMessage({
9599 block . content &&
96100 block . content . length > 0
97101 ) {
98- const imageBlock = block . content [ 0 ] ;
99- if ( isImageContentBlock ( imageBlock ) ) {
100- return (
101- < div
102- key = { blockIndex }
103- data-message-index = { messageIdToIndex [ message . id ] }
104- data-block-index = { blockIndex }
105- style = { {
106- position : "absolute" ,
107- width : 0 ,
108- height : 0 ,
109- overflow : "hidden" ,
110- } }
111- />
112- ) ;
113- }
102+ // Check ALL content items in the tool result, not just the first one
103+ const markers : React . ReactNode [ ] = [ ] ;
104+ block . content . forEach ( ( contentItem , contentIndex ) => {
105+ if ( isImageContentBlock ( contentItem ) ) {
106+ markers . push (
107+ < div
108+ key = { `${ blockIndex } -${ contentIndex } ` }
109+ data-message-index = { messageIdToIndex [ message . id ] }
110+ data-block-index = { blockIndex }
111+ data-content-index = { contentIndex }
112+ style = { {
113+ position : "absolute" ,
114+ width : 0 ,
115+ height : 0 ,
116+ overflow : "hidden" ,
117+ } }
118+ />
119+ ) ;
120+ }
121+ } ) ;
122+ return markers ;
114123 }
115124 return null ;
116125 } ) }
0 commit comments