diff --git a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer.swift b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer.swift index 3cd290389fe..58974dff125 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatComposer.swift @@ -9,7 +9,7 @@ import UniformTypeIdentifiers @MainActor struct OpenClawChatComposer: View { - private static let menuThinkingLevels = ["off", "low", "medium", "high"] + private static let menuThinkingLevels = ["off", "low", "medium", "high", "adaptive"] @Bindable var viewModel: OpenClawChatViewModel let style: OpenClawChatView.Style @@ -99,6 +99,7 @@ struct OpenClawChatComposer: View { Text("Low").tag("low") Text("Medium").tag("medium") Text("High").tag("high") + Text("Adaptive").tag("adaptive") if !Self.menuThinkingLevels.contains(self.viewModel.thinkingLevel) { Text(self.viewModel.thinkingLevel.capitalized).tag(self.viewModel.thinkingLevel) } diff --git a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift index c760fad30d5..a6236e02cc1 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift @@ -180,8 +180,13 @@ public struct OpenClawChatView: View { } .onChange(of: self.viewModel.streamingAssistantText) { _, _ in guard self.hasPerformedInitialScroll, self.isPinnedToBottom else { return } - withAnimation(.snappy(duration: 0.22)) { - self.scrollPosition = self.scrollerBottomID + // Defer past the current layout pass to avoid "onChange tried to update + // multiple times per frame" warnings during rapid streaming token delivery. + Task { @MainActor in + guard self.hasPerformedInitialScroll, self.isPinnedToBottom else { return } + withAnimation(.snappy(duration: 0.22)) { + self.scrollPosition = self.scrollerBottomID + } } } }