mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-31 08:39:24 +00:00
Refactor owner scope across channels and fix default routing fallback (#1151)
* refactor: add explicit owner scope across channels * fix: tighten routine owner target routing * fix: address owner scope review feedback * Fix owner-scope onboarding and event trigger isolation * Tighten routing fallback and wizard owner validation * fix: address owner-scope follow-up review * fix: tighten owner-scope follow-up details * fix: import Channel trait in telegram test * fix: normalize http webhook sender ids * fix: address remaining owner-scope review issues * fix: reconcile config rebase fallout * fix: reconcile extension manager rebase drift * fix: address current copilot review regressions * fix: restore clippy matrix after rebase
This commit is contained in:
@@ -16,6 +16,14 @@ pub struct Settings {
|
||||
#[serde(default, alias = "setup_completed")]
|
||||
pub onboard_completed: bool,
|
||||
|
||||
/// Stable owner scope for this IronClaw instance.
|
||||
///
|
||||
/// This is bootstrap configuration loaded from env / disk / TOML. We do
|
||||
/// not persist it in the per-user DB settings table because the DB lookup
|
||||
/// itself already requires the owner scope to be known.
|
||||
#[serde(default)]
|
||||
pub owner_id: Option<String>,
|
||||
|
||||
// === Step 1: Database ===
|
||||
/// Database backend: "postgres" or "libsql".
|
||||
#[serde(default)]
|
||||
@@ -733,6 +741,10 @@ impl Settings {
|
||||
let mut settings = Self::default();
|
||||
|
||||
for (key, value) in map {
|
||||
if key == "owner_id" {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Convert the JSONB value to a string for the existing set() method
|
||||
let value_str = match value {
|
||||
serde_json::Value::String(s) => s.clone(),
|
||||
@@ -772,6 +784,7 @@ impl Settings {
|
||||
|
||||
let mut map = std::collections::HashMap::new();
|
||||
collect_settings_json(&json, String::new(), &mut map);
|
||||
map.remove("owner_id");
|
||||
map
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user