@@ -369,41 +369,6 @@ public final class OpenClawChatViewModel {
369369 Task { await self . performAbort ( ) }
370370 }
371371
372- public func refreshSessions( limit: Int ? = nil ) {
373- let context = self . currentSessionSnapshot ( )
374- Task { await self . fetchSessions ( limit: limit, sessionSnapshot: context) }
375- }
376-
377- public func startNewSession( worktree: Bool = false ) async {
378- await self . performStartNewSession ( worktree: worktree)
379- }
380-
381- public func requestSessionReset( ) {
382- Task { await self . performReset ( ) }
383- }
384-
385- public func requestSessionCompact( ) {
386- Task { await self . performCompact ( ) }
387- }
388-
389- public func setSessionPinned( _ sessionKey: String , pinned: Bool ) {
390- Task {
391- do {
392- try await self . transport. patchSession (
393- key: sessionKey,
394- label: nil ,
395- category: nil ,
396- pinned: pinned,
397- archived: nil ,
398- unread: nil )
399- } catch {
400- self . errorText = error. localizedDescription
401- return
402- }
403- await self . fetchSessions ( limit: nil , sessionSnapshot: self . currentSessionSnapshot ( ) )
404- }
405- }
406-
407372 public func deleteSession( _ sessionKey: String ) {
408373 Task {
409374 do {
@@ -1565,7 +1530,7 @@ public final class OpenClawChatViewModel {
15651530 }
15661531 }
15671532
1568- private func fetchSessions( limit: Int ? , sessionSnapshot: SessionSnapshot ? = nil ) async {
1533+ func fetchSessions( limit: Int ? , sessionSnapshot: SessionSnapshot ? = nil ) async {
15691534 do {
15701535 let res = try await transport. listSessions ( limit: limit, search: nil , archived: false )
15711536 if let sessionSnapshot, !self . isCurrentSession ( sessionSnapshot) { return }
@@ -1765,7 +1730,7 @@ public final class OpenClawChatViewModel {
17651730 self . applySessionSwitch ( to: sessionKey, intent: . externalSync)
17661731 }
17671732
1768- private func performStartNewSession( worktree: Bool ) async {
1733+ func performStartNewSession( worktree: Bool ) async {
17691734 guard !self . blocksAttachmentOwnerChange else {
17701735 self . errorText = String (
17711736 localized: " Remove attachments or wait for delivery to resolve before starting a new chat. " )
@@ -1828,7 +1793,7 @@ public final class OpenClawChatViewModel {
18281793 && nsError. localizedDescription == " sessions.create not supported by this transport "
18291794 }
18301795
1831- private func performReset( ) async {
1796+ func performReset( ) async {
18321797 self . isLoading = true
18331798 self . errorText = nil
18341799
@@ -1846,7 +1811,7 @@ public final class OpenClawChatViewModel {
18461811 self . startBootstrap ( )
18471812 }
18481813
1849- private func performCompact( ) async {
1814+ func performCompact( ) async {
18501815 guard !self . isCompacting else { return }
18511816 guard !self . isSending, self . pendingRuns. isEmpty, !self . isAborting else {
18521817 self . errorText = " Wait for the current response before compacting the session. "
0 commit comments