瀏覽代碼

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

Ravi Kumar 10 月之前
父節點
當前提交
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 })