Skip to content

Commit fdf560c

Browse files
fix(tui): --continue selects wrong session (anomalyco#5513)
1 parent fc3ffb2 commit fdf560c

File tree

1 file changed

+3
-1
lines changed
  • packages/opencode/src/cli/cmd/tui

1 file changed

+3
-1
lines changed

packages/opencode/src/cli/cmd/tui/app.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ function App() {
218218
let continued = false
219219
createEffect(() => {
220220
if (continued || sync.status !== "complete" || !args.continue) return
221-
const match = sync.data.session.find((x) => x.parentID === undefined)?.id
221+
const match = sync.data.session
222+
.toSorted((a, b) => b.time.updated - a.time.updated)
223+
.find((x) => x.parentID === undefined)?.id
222224
if (match) {
223225
continued = true
224226
route.navigate({ type: "session", sessionID: match })

0 commit comments

Comments
 (0)