Skip to content

Commit c69a8d6

Browse files
authored
perf(control-ui): hydrate chat startup state
Add a combined chat.startup gateway method for Control UI startup hydration so first chat load can receive history and agents in one RPC, while falling back to chat.history for older/unadvertised gateways. Verified with focused UI/gateway tests, tsgo/oxlint/diff checks, clean autoreview, and Testbox changed gate tbx_01kt1dt6fqdtdbprsk48z8fn71.
1 parent d8ebbed commit c69a8d6

12 files changed

Lines changed: 523 additions & 210 deletions

File tree

src/gateway/methods/core-descriptors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export const CORE_GATEWAY_METHOD_SPECS: readonly CoreGatewayMethodSpec[] = [
200200
{ name: "agent.identity.get", scope: "operator.read" },
201201
{ name: "agent.wait", scope: "operator.write", startup: true },
202202
{ name: "chat.history", scope: "operator.read", startup: true },
203+
{ name: "chat.startup", scope: "operator.read", startup: true },
203204
{ name: "chat.message.get", scope: "operator.read", startup: true },
204205
{ name: "chat.abort", scope: "operator.write" },
205206
{ name: "chat.send", scope: "operator.write" },

src/gateway/server-methods.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,14 @@ export const coreGatewayHandlers: GatewayRequestHandlers = {
277277
loadHandlers: loadChannelsHandlers,
278278
}),
279279
...createLazyCoreHandlers({
280-
methods: ["chat.history", "chat.message.get", "chat.abort", "chat.send", "chat.inject"],
280+
methods: [
281+
"chat.history",
282+
"chat.startup",
283+
"chat.message.get",
284+
"chat.abort",
285+
"chat.send",
286+
"chat.inject",
287+
],
281288
loadHandlers: loadChatHandlers,
282289
}),
283290
...createLazyCoreHandlers({

0 commit comments

Comments
 (0)