Просмотр исходного кода

fix(tui): --continue selects wrong session (#5513)

Ravi Kumar 2 месяцев назад
Родитель
Сommit
fdf560c343
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      packages/opencode/src/cli/cmd/tui/app.tsx

+ 3 - 1
packages/opencode/src/cli/cmd/tui/app.tsx

@@ -218,7 +218,9 @@ function App() {
   let continued = false
   createEffect(() => {
     if (continued || sync.status !== "complete" || !args.continue) return
-    const match = sync.data.session.find((x) => x.parentID === undefined)?.id
+    const match = sync.data.session
+      .toSorted((a, b) => b.time.updated - a.time.updated)
+      .find((x) => x.parentID === undefined)?.id
     if (match) {
       continued = true
       route.navigate({ type: "session", sessionID: match })