chat: add model switching and preloaded instructions
Expose the OpenCode model list and session model switch over the chat protocol, carry a per-session model provider on chat rows, and apply a preloaded behavior brief as a durable session instruction entry when a chat is created.
This commit is contained in:
@@ -64,6 +64,11 @@ export const Protocol = Object.freeze({
|
||||
CHAT_STAR: "chat_star",
|
||||
CHAT_RENAME: "chat_rename",
|
||||
CHAT_BACKENDS: "chat_backends",
|
||||
// Model selection for one chat. `chat_models` uses the usual `chat_query`
|
||||
// session body and replies in `chat_models`; `chat_model` carries
|
||||
// `{session_id,provider,model}` in `chat_model` and echoes it.
|
||||
CHAT_MODELS: "chat_models",
|
||||
CHAT_MODEL: "chat_model",
|
||||
// The shared live stream (C5). `chat_subscribe` attaches this connection to one
|
||||
// session's stream (body: the session id); the server then pushes `chat_event`
|
||||
// frames without a matching request id, so every client watching a session sees
|
||||
@@ -119,6 +124,8 @@ export const ChatKeys = Object.freeze({
|
||||
ANSWER: "chat_answer",
|
||||
RENAME: "chat_rename",
|
||||
BACKENDS: "chat_backends",
|
||||
MODELS: "chat_models",
|
||||
MODEL: "chat_model",
|
||||
// The composer's payloads (C8/C9). `chat_interrupt` deliberately has no key of
|
||||
// its own: its body is the same `chat_query` the other session-scoped commands
|
||||
// carry (internal/protocol/chat.go ChatQuery, Chat.kt interruptRequest), so a
|
||||
|
||||
Reference in New Issue
Block a user