fix(opencode): remove automatic full session diffs (#30127)

This commit is contained in:
Dax
2026-05-31 13:34:14 -04:00
committed by GitHub
parent a69b70d5ca
commit 2f2fcc1654
5 changed files with 64 additions and 42 deletions
+3 -7
View File
@@ -25,7 +25,6 @@ import { or } from "drizzle-orm"
import type { SQL } from "drizzle-orm"
import { PartTable, SessionTable } from "@opencode-ai/core/session/sql"
import { ProjectTable } from "@opencode-ai/core/project/sql"
import { Storage } from "@/storage/storage"
import * as Log from "@opencode-ai/core/util/log"
import { MessageV2 } from "./message-v2"
import type { InstanceContext } from "../project/instance-context"
@@ -536,7 +535,7 @@ export type Patch = Omit<Partial<Info>, "time" | "share" | "summary" | "revert"
export const layer: Layer.Layer<
Service,
never,
BackgroundJob.Service | Storage.Service | RuntimeFlags.Service | Database.Service | EventV2Bridge.Service
BackgroundJob.Service | RuntimeFlags.Service | Database.Service | EventV2Bridge.Service
> = Layer.effect(
Service,
Effect.gen(function* () {
@@ -544,7 +543,6 @@ export const layer: Layer.Layer<
const database = yield* Database.Service
const background = yield* BackgroundJob.Service
const events = yield* EventV2Bridge.Service
const storage = yield* Storage.Service
const flags = yield* RuntimeFlags.Service
const locationForSession = Effect.fnUntraced(function* (sessionID: SessionID) {
@@ -887,9 +885,8 @@ export const layer: Layer.Layer<
})
const diff = Effect.fn("Session.diff")(function* (sessionID: SessionID) {
return yield* storage
.read<Snapshot.FileDiff[]>(["session_diff", sessionID])
.pipe(Effect.orElseSucceed((): Snapshot.FileDiff[] => []))
void sessionID
return [] as Snapshot.FileDiff[]
})
const messages: Interface["messages"] = Effect.fn("Session.messages")(function* (input) {
@@ -1013,7 +1010,6 @@ export const layer: Layer.Layer<
export const defaultLayer = layer.pipe(
Layer.provide(BackgroundJob.defaultLayer),
Layer.provide(Storage.defaultLayer),
Layer.provide(Database.defaultLayer),
Layer.provide(EventV2Bridge.defaultLayer),
Layer.provide(SessionV2.defaultLayer),