Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(config): a user time zone setting, ahead of the device's

M3gA-Minde3e13685cb3a
diff --git a/Cargo.lock b/Cargo.lock
index 6cbf710b50..6d36852436 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4255,6 +4255,7 @@ dependencies = [
"bytes",
"chacha20poly1305",
"chrono",
+ "chrono-tz",
"directories",
"dirs 6.0.0",
"dotenvy",
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 1a5c1b41be..bef4275f5e 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -388,6 +388,8 @@ futures = "0.3"
rusqlite = { version = "=0.40.2", features = ["bundled"] }
chrono = { version = "0.4", features = ["serde"] }
iana-time-zone = "0.1"
+# Validates the user's IANA time zone setting (`Config::time_zone`).
+chrono-tz = "0.10"
futures-util = "0.3"
directories = "6"
toml = "1.0"
diff --git a/crates/openhuman-core/src/config/mod.rs b/crates/openhuman-core/src/config/mod.rs
index e5692de315..79fba8ffa3 100644
--- a/crates/openhuman-core/src/config/mod.rs
+++ b/crates/openhuman-core/src/config/mod.rs
@@ -38,30 +38,31 @@ pub(crate) use schema::set_cli_inference_overrides;
#[allow(unused_imports)]
pub use schema::{
apply_runtime_proxy_to_builder, build_runtime_proxy_client,
- build_runtime_proxy_client_with_timeouts, output_language_directive, runtime_proxy_config,
- set_runtime_proxy_config, AgentConfig, AuditConfig, AutonomyConfig, BrowserComputerUseConfig,
- BrowserConfig, CapabilityProviderConfig, CapabilityProviderTrustState, ChannelsConfig,
- CompactionSettings, CompactionStrategy, ComposioConfig, ComposioDirectBaseUrls,
- ComposioHostCredential, ComputerConfig, Config, ContextConfig, CostConfig, CronConfig,
- CurlConfig, DashboardConfig, DecisionModel, DelegateAgentConfig, DiagramViewerConfig,
- DictationActivationMode, DictationConfig, DiscordConfig, DockerRuntimeConfig, EmailConfig,
- EmbeddingRouteConfig, GitbooksConfig, HttpHeader, HttpRequestConfig, IMessageConfig,
- IntegrationToggle, IntegrationsConfig, LarkConfig, LegacySearchInputs, LinqConfig,
- LocalAiConfig, LocalJailConfig, MatrixConfig, McpAuthConfig, McpClientConfig,
- McpClientIdentityConfig, McpServerConfig, McpToolExposure, MemoryConfig, ModelRouteConfig,
- MultimodalConfig, MultimodalFileConfig, ObservabilityConfig, OrchestratorModelConfig,
- PrivacyConfig, PrivacyMode, ProxyConfig, ProxyScope, ReliabilityConfig, ResourceLimitsConfig,
- RuntimeConfig, RuntimePoolConfig, RuntimePoolLangConfig, SandboxBackend, SandboxConfig,
- SchedulerConfig, SchedulerGateConfig, SchedulerGateMode, SearchConfig, SearchEngineCredentials,
- SearchPresentation, SearchProviderSettings, SearchRoute, SearxngConfig, SecretsConfig,
- SecurityConfig, ShellConfig, SlackConfig, StreamMode, SttEngine, TeamModelConfig,
- TelegramConfig, TokenjuiceConfig, UpdateConfig, UpdateRestartStrategy, VoiceActivationMode,
- VoiceServerConfig, WebSearchConfig, WebhookConfig, YuanbaoConfig, DEFAULT_MODEL,
- LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS,
- MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT, MODEL_MEDIA_UNDERSTANDING,
- MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA,
- SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY,
- SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER, SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
+ build_runtime_proxy_client_with_timeouts, device_time_zone, normalize_time_zone,
+ output_language_directive, runtime_proxy_config, set_runtime_proxy_config, AgentConfig,
+ AuditConfig, AutonomyConfig, BrowserComputerUseConfig, BrowserConfig, CapabilityProviderConfig,
+ CapabilityProviderTrustState, ChannelsConfig, CompactionSettings, CompactionStrategy,
+ ComposioConfig, ComposioDirectBaseUrls, ComposioHostCredential, ComputerConfig, Config,
+ ContextConfig, CostConfig, CronConfig, CurlConfig, DashboardConfig, DecisionModel,
+ DelegateAgentConfig, DiagramViewerConfig, DictationActivationMode, DictationConfig,
+ DiscordConfig, DockerRuntimeConfig, EmailConfig, EmbeddingRouteConfig, GitbooksConfig,
+ HttpHeader, HttpRequestConfig, IMessageConfig, IntegrationToggle, IntegrationsConfig,
+ LarkConfig, LegacySearchInputs, LinqConfig, LocalAiConfig, LocalJailConfig, MatrixConfig,
+ McpAuthConfig, McpClientConfig, McpClientIdentityConfig, McpServerConfig, McpToolExposure,
+ MemoryConfig, ModelRouteConfig, MultimodalConfig, MultimodalFileConfig, ObservabilityConfig,
+ OrchestratorModelConfig, PrivacyConfig, PrivacyMode, ProxyConfig, ProxyScope,
+ ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig, RuntimePoolConfig,
+ RuntimePoolLangConfig, SandboxBackend, SandboxConfig, SchedulerConfig, SchedulerGateConfig,
+ SchedulerGateMode, SearchConfig, SearchEngineCredentials, SearchPresentation,
+ SearchProviderSettings, SearchRoute, SearxngConfig, SecretsConfig, SecurityConfig, ShellConfig,
+ SlackConfig, StreamMode, SttEngine, TeamModelConfig, TelegramConfig, TokenjuiceConfig,
+ UpdateConfig, UpdateRestartStrategy, VoiceActivationMode, VoiceServerConfig, WebSearchConfig,
+ WebhookConfig, YuanbaoConfig, DEFAULT_MODEL, LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS,
+ MANAGED_SEARCH_PROVIDERS, MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT,
+ MODEL_MEDIA_UNDERSTANDING, MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE,
+ SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
+ SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER,
+ SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
};
// Kept as a separate re-export (issue #4117) so the large alphabetized group
// above stays byte-identical and rustfmt-stable.
diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs
index a4744df5b9..d3718bddad 100644
--- a/crates/openhuman-core/src/config/ops/mod.rs
+++ b/crates/openhuman-core/src/config/ops/mod.rs
@@ -72,11 +72,11 @@ pub use search::{
search_settings_json, SearchProviderPatch, SearchSettingsPatch,
};
pub use ui::{
- apply_analytics_settings, apply_browser_settings, get_dictation_settings,
+ apply_analytics_settings, apply_browser_settings, apply_user_timezone, get_dictation_settings,
get_onboarding_completed, get_voice_server_settings, load_and_apply_analytics_settings,
load_and_apply_browser_settings, load_and_apply_dictation_settings,
- load_and_apply_voice_server_settings, set_onboarding_completed,
- workspace_onboarding_flag_exists, workspace_onboarding_flag_resolve,
+ load_and_apply_user_timezone, load_and_apply_voice_server_settings, set_onboarding_completed,
+ user_timezone_json, workspace_onboarding_flag_exists, workspace_onboarding_flag_resolve,
workspace_onboarding_flag_set, AnalyticsSettingsPatch, BrowserSettingsPatch,
DictationSettingsPatch, VoiceServerSettingsPatch,
};
diff --git a/crates/openhuman-core/src/config/ops/ui.rs b/crates/openhuman-core/src/config/ops/ui.rs
index acfa5987a3..8511c55692 100644
--- a/crates/openhuman-core/src/config/ops/ui.rs
+++ b/crates/openhuman-core/src/config/ops/ui.rs
@@ -179,6 +179,52 @@ pub async fn apply_analytics_settings(
))
}
+/// Sets the user's time zone (`None`, or a blank name, follows the device
+/// again). The name must be an IANA zone; it is stored in its canonical form.
+pub async fn apply_user_timezone(
+ config: &mut Config,
+ timezone: Option<String>,
+) -> Result<Outcome<serde_json::Value>, String> {
+ let requested = timezone.as_deref().map(str::trim).filter(|z| !z.is_empty());
+ config.user_timezone = match requested {
+ None => None,
+ Some(zone) => Some(
+ crate::config::normalize_time_zone(zone)
+ .ok_or_else(|| format!("{zone:?} is not an IANA time zone (e.g. Asia/Kolkata)"))?,
+ ),
+ };
+ config.save().await.map_err(|e| e.to_string())?;
+ log::info!(
+ "[config] user time zone set: {}",
+ config.user_timezone.as_deref().unwrap_or("device")
+ );
+ let snapshot = snapshot_config_json(config)?;
+ Ok(Outcome::new(
+ snapshot,
+ vec![format!(
+ "time zone saved to {}",
+ config.config_path.display()
+ )],
+ ))
+}
+
+/// Loads the configuration, sets the user's time zone, and saves it.
+pub async fn load_and_apply_user_timezone(
+ timezone: Option<String>,
+) -> Result<Outcome<serde_json::Value>, String> {
+ let mut config = load_config_with_timeout().await?;
+ apply_user_timezone(&mut config, timezone).await
+}
+
+/// The user's time zone setting, the device's zone, and the one in effect.
+pub fn user_timezone_json(config: &Config) -> serde_json::Value {
+ json!({
+ "timezone": config.user_timezone,
+ "device": crate::config::device_time_zone(),
+ "effective": config.time_zone(),
+ })
+}
+
/// Loads the configuration, applies analytics settings updates, and saves it.
pub async fn load_and_apply_analytics_settings(
update: AnalyticsSettingsPatch,
diff --git a/crates/openhuman-core/src/config/ops_model_and_local_ai_tests.rs b/crates/openhuman-core/src/config/ops_model_and_local_ai_tests.rs
index bb4792197c..257b3b77a5 100644
--- a/crates/openhuman-core/src/config/ops_model_and_local_ai_tests.rs
+++ b/crates/openhuman-core/src/config/ops_model_and_local_ai_tests.rs
@@ -666,3 +666,35 @@ async fn apply_analytics_settings_updates_enabled() {
.expect("apply");
assert!(!cfg.observability.analytics_enabled);
}
+
+#[tokio::test]
+async fn apply_user_timezone_stores_the_canonical_name_refuses_junk_and_clears() {
+ let tmp = tempdir().unwrap();
+ let mut cfg = tmp_config(&tmp);
+
+ apply_user_timezone(&mut cfg, Some(" asia/kolkata ".into()))
+ .await
+ .expect("an IANA zone in any case is accepted");
+ assert_eq!(cfg.user_timezone.as_deref(), Some("Asia/Kolkata"));
+ assert_eq!(cfg.time_zone(), "Asia/Kolkata");
+ let saved = std::fs::read_to_string(&cfg.config_path).expect("config was saved");
+ assert!(saved.contains("Asia/Kolkata"), "{saved}");
+
+ let error = apply_user_timezone(&mut cfg, Some("IST".into()))
+ .await
+ .expect_err("an abbreviation is not a zone");
+ assert!(error.contains("IST"), "{error}");
+ assert_eq!(
+ cfg.user_timezone.as_deref(),
+ Some("Asia/Kolkata"),
+ "unchanged"
+ );
+
+ apply_user_timezone(&mut cfg, Some(" ".into()))
+ .await
+ .expect("blank clears");
+ assert_eq!(cfg.user_timezone, None);
+ let json = user_timezone_json(&cfg);
+ assert!(json["timezone"].is_null());
+ assert_eq!(json["effective"], cfg.time_zone());
+}
diff --git a/crates/openhuman-core/src/config/schema/types.rs b/crates/openhuman-core/src/config/schema/types.rs
index 0e7a0762a6..dff954704a 100644
--- a/crates/openhuman-core/src/config/schema/types.rs
+++ b/crates/openhuman-core/src/config/schema/types.rs
@@ -9,6 +9,7 @@ mod defaults;
mod model_ids;
mod output_language;
mod resolvers;
+mod time_zone;
pub use config::{Config, CustomEmbeddingsConfig, ModelRegistryEntry};
pub use model_ids::{
@@ -17,6 +18,7 @@ pub use model_ids::{
MODEL_MEDIA_UNDERSTANDING, MODEL_VIDEO_GENERATION_AGENT, WORKLOAD_ROLES,
};
pub use output_language::{normalize_output_language, output_language_directive};
+pub use time_zone::{device_time_zone, normalize_time_zone};
#[cfg(test)]
use crate::config::schema::{CapabilityProviderTrustState, TeamModelConfig};
diff --git a/crates/openhuman-core/src/config/schema/types/config.rs b/crates/openhuman-core/src/config/schema/types/config.rs
index 4de1176c51..c38ef51ce9 100644
--- a/crates/openhuman-core/src/config/schema/types/config.rs
+++ b/crates/openhuman-core/src/config/schema/types/config.rs
@@ -134,6 +134,12 @@ pub struct Config {
#[serde(default)]
pub output_language: Option<String>,
+ /// The user's IANA time zone (`Asia/Kolkata`), chosen in Settings →
+ /// Account. `None` follows the device. Read it through
+ /// [`Config::time_zone`], which also validates it.
+ #[serde(default)]
+ pub user_timezone: Option<String>,
+
/// Models (by exact ID match OR shell-style glob like `gpt-5*`, `o1-*`) that
/// MUST NOT receive a `temperature` parameter. Used for reasoning models
/// that error out when temperature is set (OpenAI o-series, GPT-5).
diff --git a/crates/openhuman-core/src/config/schema/types/config_clone.rs b/crates/openhuman-core/src/config/schema/types/config_clone.rs
index 0b06393360..d5fd546e58 100644
--- a/crates/openhuman-core/src/config/schema/types/config_clone.rs
+++ b/crates/openhuman-core/src/config/schema/types/config_clone.rs
@@ -27,6 +27,7 @@ impl Clone for Config {
default_model: self.default_model.clone(),
default_temperature: self.default_temperature,
output_language: self.output_language.clone(),
+ user_timezone: self.user_timezone.clone(),
temperature_unsupported_models: self.temperature_unsupported_models.clone(),
dashboard: self.dashboard.clone(),
observability: self.observability.clone(),
diff --git a/crates/openhuman-core/src/config/schema/types/defaults.rs b/crates/openhuman-core/src/config/schema/types/defaults.rs
index 13179732f8..f48399118f 100644
--- a/crates/openhuman-core/src/config/schema/types/defaults.rs
+++ b/crates/openhuman-core/src/config/schema/types/defaults.rs
@@ -41,6 +41,7 @@ impl Default for Config {
default_model: Some(DEFAULT_MODEL.to_string()),
default_temperature: DEFAULT_TEMPERATURE,
output_language: None,
+ user_timezone: None,
temperature_unsupported_models: default_temperature_unsupported_models(),
observability: ObservabilityConfig::default(),
dashboard: DashboardConfig::default(),
diff --git a/crates/openhuman-core/src/config/schema/types/time_zone.rs b/crates/openhuman-core/src/config/schema/types/time_zone.rs
new file mode 100644
index 0000000000..ad70bdf647
--- /dev/null
+++ b/crates/openhuman-core/src/config/schema/types/time_zone.rs
@@ -0,0 +1,47 @@
+//! The user's time zone: set in Settings → Account, else the device's.
+//!
+//! Everything that reads a local date for the user (what "yesterday" means,
+//! which calendar day a memory fell on) goes through [`Config::time_zone`],
+//! so the user's choice wins over where the machine thinks it is.
+
+use super::Config;
+
+/// The IANA name `zone` normalises to (`Asia/Kolkata`), or `None` when it is
+/// blank or not an IANA zone. Case and surrounding space are forgiven; an
+/// abbreviation (`IST`) or an offset (`+05:30`) is not a zone.
+pub fn normalize_time_zone(zone: &str) -> Option<String> {
+ let trimmed = zone.trim();
+ if trimmed.is_empty() {
+ return None;
+ }
+ let tz = trimmed.parse::<chrono_tz::Tz>().ok().or_else(|| {
+ chrono_tz::TZ_VARIANTS
+ .iter()
+ .copied()
+ .find(|tz| tz.name().eq_ignore_ascii_case(trimmed))
+ })?;
+ Some(tz.name().to_string())
+}
+
+/// The device's IANA zone, when the host can resolve one.
+pub fn device_time_zone() -> Option<String> {
+ iana_time_zone::get_timezone()
+ .ok()
+ .and_then(|zone| normalize_time_zone(&zone))
+}
+
+impl Config {
+ /// The user's time zone: [`Config::user_timezone`] when it is a valid
+ /// IANA zone, else the device's, else `UTC`.
+ pub fn time_zone(&self) -> String {
+ self.user_timezone
+ .as_deref()
+ .and_then(normalize_time_zone)
+ .or_else(device_time_zone)
+ .unwrap_or_else(|| "UTC".to_string())
+ }
+}
+
+#[cfg(test)]
+#[path = "time_zone_tests.rs"]
+mod tests;
diff --git a/crates/openhuman-core/src/config/schema/types/time_zone_tests.rs b/crates/openhuman-core/src/config/schema/types/time_zone_tests.rs
new file mode 100644
index 0000000000..3dbad2c8c2
--- /dev/null
+++ b/crates/openhuman-core/src/config/schema/types/time_zone_tests.rs
@@ -0,0 +1,42 @@
+use super::*;
+
+#[test]
+fn iana_names_normalise_and_everything_else_is_refused() {
+ assert_eq!(
+ normalize_time_zone(" Asia/Kolkata ").as_deref(),
+ Some("Asia/Kolkata")
+ );
+ assert_eq!(
+ normalize_time_zone("asia/kolkata").as_deref(),
+ Some("Asia/Kolkata")
+ );
+ assert_eq!(normalize_time_zone("UTC").as_deref(), Some("UTC"));
+ for bad in ["", " ", "IST", "+05:30", "Asia/Mumbai", "Mars/Olympus"] {
+ assert_eq!(
+ normalize_time_zone(bad),
+ None,
+ "{bad:?} is not an IANA zone"
+ );
+ }
+}
+
+#[test]
+fn the_users_zone_wins_over_the_device() {
+ let config = Config {
+ user_timezone: Some("America/Sao_Paulo".into()),
+ ..Config::default()
+ };
+ assert_eq!(config.time_zone(), "America/Sao_Paulo");
+}
+
+#[test]
+fn no_or_an_invalid_user_zone_falls_back_to_the_device_then_utc() {
+ let fallback = device_time_zone().unwrap_or_else(|| "UTC".to_string());
+ for user in [None, Some("IST".to_string())] {
+ let config = Config {
+ user_timezone: user,
+ ..Config::default()
+ };
+ assert_eq!(config.time_zone(), fallback);
+ }
+}
diff --git a/crates/openhuman-core/src/config/schemas/controllers/registry.rs b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
index 3355079932..e2e41ffa2a 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/registry.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
@@ -26,9 +26,9 @@ use super::voice::{
use super::workspace::{
handle_agent_server_status, handle_get_agent_paths, handle_get_analytics_settings,
handle_get_dashboard_settings, handle_get_data_paths, handle_get_onboarding_completed,
- handle_reset_local_data, handle_set_onboarding_completed, handle_update_agent_paths,
- handle_update_analytics_settings, handle_workspace_onboarding_flag_exists,
- handle_workspace_onboarding_flag_set,
+ handle_get_user_timezone, handle_reset_local_data, handle_set_onboarding_completed,
+ handle_update_agent_paths, handle_update_analytics_settings, handle_update_user_timezone,
+ handle_workspace_onboarding_flag_exists, handle_workspace_onboarding_flag_set,
};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
@@ -48,6 +48,8 @@ pub fn all_controller_schemas() -> Vec<ControllerSchema> {
schemas("workspace_onboarding_flag_set"),
schemas("update_analytics_settings"),
schemas("get_analytics_settings"),
+ schemas("update_user_timezone"),
+ schemas("get_user_timezone"),
schemas("get_dashboard_settings"),
schemas("agent_server_status"),
schemas("reset_local_data"),
@@ -137,6 +139,14 @@ pub fn all_registered_controllers() -> Vec<RegisteredController> {
schema: schemas("get_analytics_settings"),
handler: handle_get_analytics_settings,
},
+ RegisteredController {
+ schema: schemas("update_user_timezone"),
+ handler: handle_update_user_timezone,
+ },
+ RegisteredController {
+ schema: schemas("get_user_timezone"),
+ handler: handle_get_user_timezone,
+ },
RegisteredController {
schema: schemas("get_dashboard_settings"),
handler: handle_get_dashboard_settings,
diff --git a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
index f6be4a882b..292523eac4 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
@@ -7,8 +7,8 @@ use crate::core::all::ControllerFuture;
use super::super::helpers::{
deserialize_params, to_json, AgentPathsUpdate, AnalyticsSettingsUpdate,
- OnboardingCompletedSetParams, WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams,
- DEFAULT_ONBOARDING_FLAG_NAME,
+ OnboardingCompletedSetParams, UserTimezoneUpdate, WorkspaceOnboardingFlagParams,
+ WorkspaceOnboardingFlagSetParams, DEFAULT_ONBOARDING_FLAG_NAME,
};
pub(super) fn handle_workspace_onboarding_flag_exists(
@@ -50,6 +50,23 @@ pub(super) fn handle_update_analytics_settings(params: Map<String, Value>) -> Co
})
}
+pub(super) fn handle_update_user_timezone(params: Map<String, Value>) -> ControllerFuture {
+ Box::pin(async move {
+ let update = deserialize_params::<UserTimezoneUpdate>(params)?;
+ to_json(config_rpc::load_and_apply_user_timezone(update.timezone).await?)
+ })
+}
+
+pub(super) fn handle_get_user_timezone(_params: Map<String, Value>) -> ControllerFuture {
+ Box::pin(async {
+ let config = config_rpc::load_config_with_timeout().await?;
+ to_json(crate::core::Outcome::single_log(
+ config_rpc::user_timezone_json(&config),
+ "user time zone read",
+ ))
+ })
+}
+
pub(super) fn handle_get_analytics_settings(_params: Map<String, Value>) -> ControllerFuture {
Box::pin(async {
use crate::core::Outcome;
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index ce5dcd3e87..9c00bbf1d5 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -116,6 +116,12 @@ pub(super) struct AnalyticsSettingsUpdate {
pub(super) enabled: Option<bool>,
}
+#[derive(Debug, Deserialize)]
+pub(super) struct UserTimezoneUpdate {
+ #[serde(default)]
+ pub(super) timezone: Option<String>,
+}
+
#[derive(Debug, Deserialize)]
pub(super) struct LocalAiSettingsUpdate {
pub(super) runtime_enabled: Option<bool>,
diff --git a/crates/openhuman-core/src/config/schemas/mod.rs b/crates/openhuman-core/src/config/schemas/mod.rs
index f7eb9ea299..3832312c32 100644
--- a/crates/openhuman-core/src/config/schemas/mod.rs
+++ b/crates/openhuman-core/src/config/schemas/mod.rs
@@ -24,7 +24,8 @@
//! `update_browser_settings`, `update_local_ai_settings`, `resolve_api_url`,
//! `get_runtime_flags`, `set_browser_allow_all`, `workspace_onboarding_flag_exists`,
//! `workspace_onboarding_flag_set`, `update_analytics_settings`,
-//! `get_analytics_settings`, `get_dashboard_settings`, `agent_server_status`,
+//! `get_analytics_settings`, `update_user_timezone`, `get_user_timezone`,
+//! `get_dashboard_settings`, `agent_server_status`,
//! `reset_local_data`, `get_data_paths`, `get_agent_paths`, `update_agent_paths`,
//! `get_onboarding_completed`, `set_onboarding_completed`, `get_dictation_settings`,
//! `update_dictation_settings`, `get_voice_server_settings`,
diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/workspace.rs b/crates/openhuman-core/src/config/schemas/schema_defs/workspace.rs
index 0ee42b5668..f5effeee05 100644
--- a/crates/openhuman-core/src/config/schemas/schema_defs/workspace.rs
+++ b/crates/openhuman-core/src/config/schemas/schema_defs/workspace.rs
@@ -58,6 +58,26 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {
)],
outputs: vec![json_output("snapshot", "Updated config snapshot.")],
}),
+"update_user_timezone" => Some( ControllerSchema {
+ namespace: "config",
+ function: "update_user_timezone",
+ description: "Set the user's IANA time zone; null or blank follows the device.",
+ inputs: vec![optional_string(
+ "timezone",
+ "IANA time zone name, e.g. Asia/Kolkata; null or blank to follow the device.",
+ )],
+ outputs: vec![json_output("snapshot", "Updated config snapshot.")],
+ }),
+"get_user_timezone" => Some( ControllerSchema {
+ namespace: "config",
+ function: "get_user_timezone",
+ description: "Read the user's time zone setting, the device's zone, and the one in effect.",
+ inputs: vec![],
+ outputs: vec![json_output(
+ "settings",
+ "{ timezone: string | null, device: string | null, effective: string }.",
+ )],
+ }),
"get_analytics_settings" => Some( ControllerSchema {
namespace: "config",
function: "get_analytics_settings",
diff --git a/crates/openhuman-core/src/config/schemas_tests.rs b/crates/openhuman-core/src/config/schemas_tests.rs
index b160b807ea..a845b7d431 100644
--- a/crates/openhuman-core/src/config/schemas_tests.rs
+++ b/crates/openhuman-core/src/config/schemas_tests.rs
@@ -26,6 +26,8 @@ fn every_registered_key_resolves_to_non_unknown_schema() {
"workspace_onboarding_flag_set",
"update_analytics_settings",
"get_analytics_settings",
+ "update_user_timezone",
+ "get_user_timezone",
"update_autonomy_settings",
"get_autonomy_settings",
"get_agent_settings",