chore(server): revert hosted GPT-Live on the connected OpenCode Console (#58461)

This commit is contained in:
Adam
2026-10-23 16:31:29 -05:00
committed by GitHub
Unverified
parent 2abdf9604b
commit 8d95ef805b
17 changed files with 70 additions and 940 deletions
+3 -24
View File
@@ -1,5 +1,5 @@
import { Schema } from "effect"
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api"
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api"
import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js"
export const VoiceTransportType = Schema.Literals(["webrtc", "websocket"]).annotate({
@@ -11,10 +11,6 @@ export const VoiceModel = Schema.Struct({
provider: Schema.String,
transports: Schema.Array(VoiceTransportType),
available: Schema.Boolean,
/** The integration whose connection starts its sessions: the provider's stored key, or `opencode` when the connected OpenCode Console hosts it. */
integration: Schema.optional(Schema.String),
/** The OpenCode Console workspace a hosted model's sessions bill to. */
workspace: Schema.optional(Schema.String),
}).annotate({ identifier: "VoiceModel" })
export const VoiceWebRTCTransportInput = Schema.Struct({
@@ -64,7 +60,7 @@ export const VoiceGroup = HttpApiGroup.make("server.voice")
identifier: "experimental.voice.models",
summary: "List voice models",
description:
"List supported voice models, their transports, whether the server has a usable API key for each provider or the connected OpenCode Console hosts the model, and the Console workspace a hosted model bills to.",
"List supported voice models, their transports, and whether the server has a usable API key for each provider.",
}),
),
)
@@ -78,8 +74,6 @@ export const VoiceGroup = HttpApiGroup.make("server.voice")
success: Schema.Struct({
data: Schema.Struct({
transport: VoiceTransport,
/** A hosted session's ID, for `voice.instructions`. */
session: Schema.optional(Schema.Struct({ id: Schema.String })),
}),
}).annotate({ identifier: "VoiceSessionResponse" }),
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
@@ -88,22 +82,7 @@ export const VoiceGroup = HttpApiGroup.make("server.voice")
identifier: "experimental.voice.session",
summary: "Create voice session",
description:
"Create a server-brokered voice session using the server's configured provider credentials, or the connected OpenCode Console when it hosts the model, and return the WebRTC SDP answer or WebSocket ephemeral token.",
}),
),
)
.add(
HttpApiEndpoint.post("voice.instructions", "/api/experimental/voice/session/:sessionID/instructions", {
params: { sessionID: Schema.String },
payload: Schema.Struct({ instructions: Schema.String }),
success: HttpApiSchema.NoContent,
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
}).annotateMerge(
OpenApi.annotations({
identifier: "experimental.voice.instructions",
summary: "Replace voice session instructions",
description:
"Replace the backend instructions of a running session the connected OpenCode Console hosts, whose data channel can't change them.",
"Create a server-brokered voice session using the server's configured provider credentials and return the WebRTC SDP answer or WebSocket ephemeral token.",
}),
),
)