fix(sdk): wake embedded session execution (#33992)

This commit is contained in:
Kit Langton 2026-06-26 05:04:14 +02:00 committed by GitHub
commit 40ecfceec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 53 additions and 19 deletions

View file

@ -6,9 +6,9 @@ import { Git } from "../git"
import { Location } from "../location"
import { ProjectV2 } from "../project"
import { SessionV2 } from "../session"
import { SessionExecution } from "../session/execution"
import { SessionEvent } from "../session/event"
import { SessionSchema } from "../session/schema"
import { SessionStore } from "../session/store"
import { AbsolutePath, RelativePath } from "../schema"
import path from "path"
@ -71,10 +71,11 @@ export const layer = Layer.effect(
const git = yield* Git.Service
const events = yield* EventV2.Service
const project = yield* ProjectV2.Service
const session = yield* SessionV2.Service
const sessions = yield* SessionStore.Service
const moveSession = Effect.fn("MoveSession.moveSession")(function* (input: Input) {
const current = yield* session.get(input.sessionID)
const current = yield* sessions.get(input.sessionID)
if (!current) return yield* new SessionV2.NotFoundError({ sessionID: input.sessionID })
const directory = AbsolutePath.make(input.destination.directory)
if (current.location.directory === directory) return
@ -143,6 +144,5 @@ export const defaultLayer = layer.pipe(
Layer.provide(Git.defaultLayer),
Layer.provide(EventV2.defaultLayer),
Layer.provide(ProjectV2.defaultLayer),
Layer.provide(SessionExecution.noopLayer),
Layer.provide(SessionV2.defaultLayer),
Layer.provide(SessionStore.defaultLayer),
)

View file

@ -443,7 +443,6 @@ export const defaultLayer = layer.pipe(
Layer.provide(
Layer.unwrap(Effect.promise(() => import("./location-layer")).pipe(Effect.map((m) => m.LocationServiceMap.layer))),
),
Layer.provide(SessionExecution.noopLayer),
Layer.provide(SessionStore.defaultLayer),
Layer.provide(SessionProjector.defaultLayer),
Layer.provide(EventV2.defaultLayer),

View file

@ -42,7 +42,7 @@ const layer = MoveSession.layer.pipe(
Layer.provide(Git.defaultLayer),
Layer.provide(EventV2.defaultLayer),
Layer.provide(project),
Layer.provide(sessions),
Layer.provide(SessionStore.defaultLayer),
)
const it = testEffect(
Layer.mergeAll(
@ -53,7 +53,6 @@ const it = testEffect(
project,
SessionProjector.defaultLayer,
SessionStore.defaultLayer,
SessionExecution.noopLayer,
sessions,
),
)