pub struct FeatureFlags {
pub global_chat: bool,
pub notifications: bool,
pub evals: bool,
pub app_budgets: bool,
pub agent_versions: bool,
pub voice: bool,
pub agent_delegation: bool,
pub observers: bool,
pub public_chat: bool,
}Expand description
Feature flags exposed via GET /v1/feature-flags and consumed by the frontend.
Currently backed by environment variables and deployment grade. Future: per-org flags, per-user flags, external providers.
Decision: this is the type-safe representation used throughout the backend.
The API does not serialize it directly — it exposes the untyped
FeatureFlagMap instead, so adding/removing a flag never changes
docs/api/openapi.json.
Fields§
§global_chat: boolPlatform Chat: the per-user singleton assistant chat surface — sidebar
entry, the /chat page, and the POST /v1/sessions/chat (+ voice)
endpoints. When off, the whole Platform Chat feature is disabled
(UI hidden and APIs return 404); other chat surfaces (per-session,
agent, channel) are unaffected. Experimental.
notifications: boolIn-app notifications (bell, toasts, notification SSE). Experimental.
evals: boolEvals (user-facing behavioral evals for agents). Experimental.
app_budgets: boolApp / channel scoped budgets and periodic budget resets (5h, 1d, …).
Experimental.
agent_versions: boolImmutable agent versions, snapshots, forks, and app version binding. Experimental.
voice: boolRealtime voice endpoints and microphone controls. Experimental.
agent_delegation: boolOutbound agent delegation capabilities (a2a_agent_delegation, agent_handoff).
Experimental: auto-enabled in dev, off in prod by default.
When off, these capabilities are not registered and cannot be assigned to agents.
observers: boolObservers (online scoring of production sessions). Experimental.
public_chat: boolPublic Chat (isolated, public-facing chat web app + public_chat
channel). Experimental. Gates the public endpoints, channel creation,
the builder UI, and the public web route. See specs/public-chat.md.
Implementations§
Source§impl FeatureFlags
impl FeatureFlags
Sourcepub fn for_org(system: &Self, org_enabled: &HashMap<String, bool>) -> Self
pub fn for_org(system: &Self, org_enabled: &HashMap<String, bool>) -> Self
Effective flags for an organization: deployment/system gates AND explicit org opt-in.
Org overrides default to disabled; a flag is on only when the deployment allows it
and the org has opted in (enabled: true in storage).
Sourcepub fn from_env(grade: &DeploymentGrade) -> Self
pub fn from_env(grade: &DeploymentGrade) -> Self
Compute feature flags from environment variables and deployment grade.
Sourcepub fn current() -> Self
pub fn current() -> Self
Resolve the current feature flags from env + the env-derived deployment grade.
Convenience for callers that don’t have a FeatureFlags instance handy.
Sourcepub fn to_map(&self) -> FeatureFlagMap
pub fn to_map(&self) -> FeatureFlagMap
Generic name -> enabled map for the untyped API representation.
Keys and values match the JSON wire format of the typed FeatureFlags
response body. The JSON content is equivalent; only the key order differs
(BTreeMap sorts keys, whereas the struct serializes in field order), which
is irrelevant to JSON consumers.
Sourcepub fn is_enabled(&self, flag: &str) -> bool
pub fn is_enabled(&self, flag: &str) -> bool
Look up a flag by name (for dynamic/string-based access).
Trait Implementations§
Source§impl Clone for FeatureFlags
impl Clone for FeatureFlags
Source§fn clone(&self) -> FeatureFlags
fn clone(&self) -> FeatureFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeatureFlags
impl Debug for FeatureFlags
Source§impl Default for FeatureFlags
impl Default for FeatureFlags
Source§fn default() -> FeatureFlags
fn default() -> FeatureFlags
Source§impl<'de> Deserialize<'de> for FeatureFlags
impl<'de> Deserialize<'de> for FeatureFlags
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FeatureFlags
Source§impl From<&FeatureFlags> for FeatureFlagMap
impl From<&FeatureFlags> for FeatureFlagMap
Source§fn from(flags: &FeatureFlags) -> Self
fn from(flags: &FeatureFlags) -> Self
Source§impl From<FeatureFlags> for FeatureFlagMap
impl From<FeatureFlags> for FeatureFlagMap
Source§fn from(flags: FeatureFlags) -> Self
fn from(flags: FeatureFlags) -> Self
Source§impl PartialEq for FeatureFlags
impl PartialEq for FeatureFlags
Source§impl Serialize for FeatureFlags
impl Serialize for FeatureFlags
impl StructuralPartialEq for FeatureFlags
Auto Trait Implementations§
impl Freeze for FeatureFlags
impl RefUnwindSafe for FeatureFlags
impl Send for FeatureFlags
impl Sync for FeatureFlags
impl Unpin for FeatureFlags
impl UnsafeUnpin for FeatureFlags
impl UnwindSafe for FeatureFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request