From 0ca733f7e59d2bdeffe916642c29ecc97f2f331d Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 22 Sep 2026 03:32:20 +1000 Subject: [PATCH] docs(config): point rate_limit at the Channel settings resource The rate-limit budget's runtime owner is the channel-settings control-plane resource, which the Web UI edits and which boot.loadRuntimeConfig layers over the file before boot.startRateLimiter reads it. [chat.rate_limit] is that resource's seed, not its authority. 1fe4691b's comments and commit message described the file key as the thing that documents a webhook's per-route budget, which is the pre-migration framing. Cite the resource and the layering instead, and say plainly that editing the file does not change a stored value. --- config.example.toml | 4 ++++ internal/config/config.go | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/config.example.toml b/config.example.toml index 4ac131ea1..e42afd58e 100644 --- a/config.example.toml +++ b/config.example.toml @@ -189,6 +189,10 @@ class = "ollama" # its configured route path -- a source, not a person, so it reaches the # limiter as a transport-only budget key rather than as an identity. Off by # default -- both fields must be set to a positive value. +# +# This section is the seed for the Channel settings resource. The Web UI owns +# the value a running deployment limits with (restart-required), so edit it +# there rather than here; a stored value is not overwritten by this file. # [chat.rate_limit] # window = "1m" # max_requests = 20 diff --git a/internal/config/config.go b/internal/config/config.go index f51770a47..f70748be1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -968,18 +968,26 @@ type ChatConfig struct { // RateLimit budgets inbound messages per (channel, sender) across // every chat channel. Zero MaxRequests (the default) leaves rate // limiting off entirely -- it is an opt-in control, not a default - // throttle that could surprise an existing deployment. + // throttle that could surprise an existing deployment. This key seeds + // the Channel settings resource, which the Web UI owns at runtime + // (restart-required): editing the file does not change a stored value. RateLimit RateLimitConfig `toml:"rate_limit" yaml:"rate_limit"` } // RateLimitConfig configures the sliding-window inbound rate limiter -// (internal/ratelimit) shared by every chat channel. A sender is -// identified per channel: Telegram by numeric user ID, email by the SMTP -// from address, webhook by the configured route path -- which is a source, +// (internal/ratelimit) shared by every chat channel. This type is the shape of +// the Channel settings resource (channel-settings, +// internal/app/controlplane); the file key is only that resource's seed, and +// the Web UI owns the value a running deployment limits with. Applied by +// boot.startRateLimiter from the config boot.loadRuntimeConfig layers, so a +// stored value takes effect on restart and the resource is restart-required. +// +// A sender is identified per channel: Telegram by numeric user ID, email by the +// SMTP from address, webhook by the configured route path -- which is a source, // not a person, so it reaches the limiter through the transport-only // Inbound.BudgetKey rather than through SenderID (see -// docs/prds/memory-engine-unification.md §3). Disabled unless both fields -// are set to a positive value. +// docs/prds/memory-engine-unification.md §3). Disabled unless both fields are +// set to a positive value. type RateLimitConfig struct { // Window is the rolling interval MaxRequests is budgeted over. Window time.Duration `toml:"window" yaml:"window"`