From b98df9bebe1e305d22002899ecf960c800a1d85f Mon Sep 17 00:00:00 2001 From: zoe <940942500@qq.com> Date: Mon, 2 Mar 2026 21:30:13 +0800 Subject: [PATCH] fix: list all sessions regardless of git context (#15678) Use Session.listGlobal instead of Session.list to show all sessions regardless of current project/git context. --- packages/opencode/src/cli/cmd/export.ts | 2 +- packages/opencode/src/cli/cmd/session.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/export.ts b/packages/opencode/src/cli/cmd/export.ts index 20c95bf87e9..f0344e3a653 100644 --- a/packages/opencode/src/cli/cmd/export.ts +++ b/packages/opencode/src/cli/cmd/export.ts @@ -27,7 +27,7 @@ export const ExportCommand = cmd({ }) const sessions = [] - for await (const session of Session.list()) { + for await (const session of Session.listGlobal()) { sessions.push(session) } diff --git a/packages/opencode/src/cli/cmd/session.ts b/packages/opencode/src/cli/cmd/session.ts index 7fb5fda97b9..f81bcc25af3 100644 --- a/packages/opencode/src/cli/cmd/session.ts +++ b/packages/opencode/src/cli/cmd/session.ts @@ -87,7 +87,8 @@ export const SessionListCommand = cmd({ }, handler: async (args) => { await bootstrap(process.cwd(), async () => { - const sessions = [...Session.list({ roots: true, limit: args.maxCount })] + // Use listGlobal to show all sessions regardless of current project/git context + const sessions = [...Session.listGlobal({ roots: true, limit: args.maxCount })] if (sessions.length === 0) { return