(null);
+ // Messages already in the thread when it opens are history; only new ones rise in.
+ const [initialIds] = useState(() => new Set(props.initialMessages.map((message) => message.id)));
const refresh = () => void queryClient.invalidateQueries({ queryKey: orpc.agent.threads.list.key() });
const { messages, sendMessage, status, error, clearError, regenerate, stop, addToolOutput } = useAssistantChat({
@@ -158,6 +161,7 @@ export function Conversation(props: ConversationProps) {
key={message.id}
message={message}
streaming={streaming && index === messages.length - 1}
+ enter={!initialIds.has(message.id)}
readOnly={readOnly}
statuses={statuses}
document={document}
@@ -167,14 +171,14 @@ export function Conversation(props: ConversationProps) {
))}
{status === "submitted" && (
-
+
Thinking…
)}
{stopped && !streaming && !proposedInLast && (
-
+
Stopped. No edits were proposed.