feat(gateway): add config hot reload
This commit is contained in:
@@ -447,6 +447,15 @@ export type GatewayRemoteConfig = {
|
||||
password?: string;
|
||||
};
|
||||
|
||||
export type GatewayReloadMode = "off" | "restart" | "hot" | "hybrid";
|
||||
|
||||
export type GatewayReloadConfig = {
|
||||
/** Reload strategy for config changes (default: hybrid). */
|
||||
mode?: GatewayReloadMode;
|
||||
/** Debounce window for config reloads (ms). Default: 300. */
|
||||
debounceMs?: number;
|
||||
};
|
||||
|
||||
export type GatewayConfig = {
|
||||
/** Single multiplexed port for Gateway WS + HTTP (default: 18789). */
|
||||
port?: number;
|
||||
@@ -464,6 +473,7 @@ export type GatewayConfig = {
|
||||
auth?: GatewayAuthConfig;
|
||||
tailscale?: GatewayTailscaleConfig;
|
||||
remote?: GatewayRemoteConfig;
|
||||
reload?: GatewayReloadConfig;
|
||||
};
|
||||
|
||||
export type SkillConfig = {
|
||||
@@ -1308,6 +1318,19 @@ export const ClawdisSchema = z.object({
|
||||
password: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
reload: z
|
||||
.object({
|
||||
mode: z
|
||||
.union([
|
||||
z.literal("off"),
|
||||
z.literal("restart"),
|
||||
z.literal("hot"),
|
||||
z.literal("hybrid"),
|
||||
])
|
||||
.optional(),
|
||||
debounceMs: z.number().int().min(0).optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
skills: z
|
||||
|
||||
@@ -82,6 +82,8 @@ const FIELD_LABELS: Record<string, string> = {
|
||||
"gateway.auth.token": "Gateway Token",
|
||||
"gateway.auth.password": "Gateway Password",
|
||||
"gateway.controlUi.basePath": "Control UI Base Path",
|
||||
"gateway.reload.mode": "Config Reload Mode",
|
||||
"gateway.reload.debounceMs": "Config Reload Debounce (ms)",
|
||||
"agent.workspace": "Workspace",
|
||||
"agent.model": "Default Model",
|
||||
"ui.seamColor": "Accent Color",
|
||||
@@ -100,6 +102,10 @@ const FIELD_HELP: Record<string, string> = {
|
||||
"gateway.auth.password": "Required for Tailscale funnel.",
|
||||
"gateway.controlUi.basePath":
|
||||
"Optional URL prefix where the Control UI is served (e.g. /clawdis).",
|
||||
"gateway.reload.mode":
|
||||
'Hot reload strategy for config changes ("hybrid" recommended).',
|
||||
"gateway.reload.debounceMs":
|
||||
"Debounce window (ms) before applying config changes.",
|
||||
};
|
||||
|
||||
const FIELD_PLACEHOLDERS: Record<string, string> = {
|
||||
|
||||
Reference in New Issue
Block a user