mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(core): preserve instruction state on move (#42398)
This commit is contained in:
committed by
GitHub
Unverified
parent
4836356c17
commit
b882ccc57d
@@ -436,7 +436,6 @@ const layer = Layer.effectDiscard(
|
||||
.where(eq(SessionTable.id, event.data.sessionID))
|
||||
.run()
|
||||
.pipe(Effect.orDie)
|
||||
yield* InstructionState.reset(db, event.data.sessionID)
|
||||
}),
|
||||
)
|
||||
// Sessions whose ownership came from the directory's previous resolution
|
||||
|
||||
@@ -1204,12 +1204,17 @@ describe("SessionRunnerLLM", () => {
|
||||
}),
|
||||
)
|
||||
|
||||
it.effect("interrupts a source Location runner after a Session moves", () =>
|
||||
it.effect("preserves instruction state and interrupts the source Location runner after a Session moves", () =>
|
||||
Effect.gen(function* () {
|
||||
const session = yield* setup
|
||||
const bus = yield* Bus.Service
|
||||
const { db } = yield* Database.Service
|
||||
yield* runPrompt(session, "First")
|
||||
const instructionState = yield* db
|
||||
.select()
|
||||
.from(InstructionStateTable)
|
||||
.where(eq(InstructionStateTable.session_id, sessionID))
|
||||
.get()
|
||||
|
||||
yield* bus.publish(SessionEvent.Moved, {
|
||||
sessionID,
|
||||
@@ -1218,7 +1223,7 @@ describe("SessionRunnerLLM", () => {
|
||||
})
|
||||
expect(
|
||||
yield* db.select().from(InstructionStateTable).where(eq(InstructionStateTable.session_id, sessionID)).get(),
|
||||
).toBeUndefined()
|
||||
).toEqual(instructionState)
|
||||
|
||||
yield* admit(session, "Second")
|
||||
const exit = yield* session.resume(sessionID).pipe(Effect.exit)
|
||||
|
||||
Reference in New Issue
Block a user