fix(core): preserve SDK plugins across location eviction (#35725)

This commit is contained in:
Kit Langton 2026-07-07 11:43:40 -04:00 committed by GitHub
commit 8deb0e5780
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 209 additions and 105 deletions

View file

@ -61,6 +61,7 @@ export const groupNames = {
} as const
export const endpointNames = {
"debug.location.evict": "evictLocation",
"session.messages": "list",
"integration.connect.key": "connectKey",
"integration.connect.oauth": "connectOauth",

View file

@ -1,6 +1,7 @@
import { Location } from "@opencode-ai/schema/location"
import { Schema } from "effect"
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"
import { LocationQuery, locationQueryOpenApi } from "./location.js"
export const DebugGroup = HttpApiGroup.make("server.debug")
.add(
@ -14,4 +15,18 @@ export const DebugGroup = HttpApiGroup.make("server.debug")
}),
),
)
.add(
HttpApiEndpoint.delete("debug.location.evict", "/api/debug/location", {
query: LocationQuery,
success: HttpApiSchema.NoContent,
})
.annotateMerge(locationQueryOpenApi)
.annotateMerge(
OpenApi.annotations({
identifier: "v2.debug.location.evict",
summary: "Evict a loaded location",
description: "Dispose the requested location's cached services so its next use boots them fresh.",
}),
),
)
.annotateMerge(OpenApi.annotations({ title: "debug" }))