@@ -22,6 +22,7 @@ import { Binary } from "@opencode-ai/util/binary"
2222import { createSimpleContext } from "./helper"
2323import type { Snapshot } from "@/snapshot"
2424import { useExit } from "./exit"
25+ import { useArgs } from "./args"
2526import { batch , onMount } from "solid-js"
2627import { Log } from "@/util/log"
2728import type { Path } from "@opencode-ai/sdk"
@@ -254,10 +255,18 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
254255 } )
255256
256257 const exit = useExit ( )
258+ const args = useArgs ( )
257259
258260 async function bootstrap ( ) {
259- // blocking
260- await Promise . all ( [
261+ const sessionListPromise = sdk . client . session . list ( ) . then ( ( x ) =>
262+ setStore (
263+ "session" ,
264+ ( x . data ?? [ ] ) . toSorted ( ( a , b ) => a . id . localeCompare ( b . id ) ) ,
265+ ) ,
266+ )
267+
268+ // blocking - include session.list when continuing a session
269+ const blockingRequests : Promise < unknown > [ ] = [
261270 sdk . client . config . providers ( { } , { throwOnError : true } ) . then ( ( x ) => {
262271 batch ( ( ) => {
263272 setStore ( "provider" , x . data ! . providers )
@@ -271,17 +280,15 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
271280 } ) ,
272281 sdk . client . app . agents ( { } , { throwOnError : true } ) . then ( ( x ) => setStore ( "agent" , x . data ?? [ ] ) ) ,
273282 sdk . client . config . get ( { } , { throwOnError : true } ) . then ( ( x ) => setStore ( "config" , x . data ! ) ) ,
274- ] )
283+ ...( args . continue ? [ sessionListPromise ] : [ ] ) ,
284+ ]
285+
286+ await Promise . all ( blockingRequests )
275287 . then ( ( ) => {
276288 if ( store . status !== "complete" ) setStore ( "status" , "partial" )
277289 // non-blocking
278290 Promise . all ( [
279- sdk . client . session . list ( ) . then ( ( x ) =>
280- setStore (
281- "session" ,
282- ( x . data ?? [ ] ) . toSorted ( ( a , b ) => a . id . localeCompare ( b . id ) ) ,
283- ) ,
284- ) ,
291+ ...( args . continue ? [ ] : [ sessionListPromise ] ) ,
285292 sdk . client . command . list ( ) . then ( ( x ) => setStore ( "command" , x . data ?? [ ] ) ) ,
286293 sdk . client . lsp . status ( ) . then ( ( x ) => setStore ( "lsp" , x . data ! ) ) ,
287294 sdk . client . mcp . status ( ) . then ( ( x ) => setStore ( "mcp" , x . data ! ) ) ,
0 commit comments