feat(simulation): add endpoint handshake protocol (#37157)

This commit is contained in:
Kit Langton 2026-07-15 17:46:28 -04:00 committed by GitHub
commit 5e2e0d6965
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 350 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import { InstallationVersion } from "@opencode-ai/core/installation/version"
import { Cause, Context, Effect, Fiber, FiberSet, Layer, PubSub, Queue, Ref, Schema, Semaphore, Stream } from "effect"
import { SimulationControlServer } from "../control-server"
import { SimulationProtocol } from "../protocol"
@ -211,6 +212,15 @@ function handle(
request: SimulationProtocol.Backend.Request,
) {
switch (request.method) {
case "simulation.handshake":
return SimulationProtocol.Handshake.dispatch(
{
role: "backend",
server: { name: "opencode", version: InstallationVersion },
capabilities: SimulationProtocol.Backend.Capabilities,
},
request.params,
)
case "llm.attach":
return controllerLock.withPermit(
Effect.gen(function* () {