fix(tui): list a child session when its exact ID is typed in the open menu (#62262)

This commit is contained in:
Dan Smolsky
2026-11-06 23:38:42 -05:00
committed by GitHub
Unverified
parent f9c9234364
commit 4094ce182d
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions:
const seen = new Set<string>()
const match = matched()
const list = [...data.session.list(), ...props.sessions, ...(match ? [match] : [])].filter((session) => {
if (session.parentID || seen.has(session.id)) return false
if ((session.parentID && session.id !== match?.id) || seen.has(session.id)) return false
if (session.time.archived !== undefined && session.id !== match?.id) return false
seen.add(session.id)
return true
@@ -59,7 +59,7 @@ test("selecting an unhydrated session preserves its location", async () => {
}
})
test("finds and opens an exact session ID outside the recent list", async () => {
test("finds and opens an exact child session ID outside the recent list", async () => {
const sessionID = "ses_04a7a3d82ffeIphUJgd3SnEqiv"
const remote = { directory: "/tmp/opencode/archive", workspaceID: "ws_archive" }
const fixture = await renderOpen((url) => {
@@ -68,6 +68,7 @@ test("finds and opens an exact session ID outside the recent list", async () =>
return json({
data: {
id: sessionID,
parentID: "ses_04a7a3d82ffeParentSessionID",
projectID: "proj_archive",
cost: 0,
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },