- {/* Render user result button (or preview) - Currently simplified */}
- {/* You might want a similar button style for consistency */}
-
-
- Tool Result: {pair.userResult.content?.match(/\s*<([a-zA-Z\-_]+)/)?.[1] || 'Result'} (Click button above)
- {/* Alternative: Make this a button too? */}
- {/* */}
+ {/* User Tool Result Part */}
+
+
+
+ {userResultName} Result Received
+ {/* Optional: Add a button to show result details here too? */}
+ {/* */}
@@ -1101,122 +1130,136 @@ export default function ThreadPage({ params }: { params: Promise }
// ---- Rendering Logic for Regular Messages ----
else {
const message = item as ApiMessage; // Safe cast now due to type guard
- // Skip rendering standard tool role messages if they were part of a sequence handled above
- // Note: This check might be redundant if grouping is perfect, but adds safety.
// We rely on the existing rendering for *structured* tool calls/results (message.type === 'tool_call', message.role === 'tool')
// which are populated differently (likely via streaming updates) than the raw XML content.
return (
-
-
- {/* Use existing logic for structured tool calls/results and normal messages */}
- {message.type === 'tool_call' && message.tool_call ? (
- // Existing rendering for structured tool_call type
-
-
-
- {/* Maybe pulse if active? */}
-
- Tool Call: {message.tool_call.function.name}
-
-
- {message.tool_call.function.arguments}
+ {/* Avatar (User = Right, Assistant/Tool = Left) */}
+ {message.role === 'user' ? (
+ // User bubble comes first in flex-end
+ <>
+
+ {/* User message bubble */}
+
+
+ {message.content}
- ) : message.role === 'tool' ? (
- // Existing rendering for standard 'tool' role messages
-
+ >
+ ) : (
+ // Assistant / Tool bubble on the left
+ <>
+ {/* Assistant Avatar */}
+
+
+
+ {/* Content Bubble */}
+
+ Suna
+
+
+ {/* Use existing logic for structured tool calls/results and normal messages */}
+ {message.type === 'tool_call' && message.tool_call ? (
+ // Existing rendering for structured tool_call type
+