mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +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:
+21
-7
@@ -292,6 +292,16 @@ async fn list(
|
||||
|
||||
// ── Create ──────────────────────────────────────────────────
|
||||
|
||||
fn cli_notify_config(notify_channel: Option<String>) -> NotifyConfig {
|
||||
NotifyConfig {
|
||||
channel: notify_channel,
|
||||
user: None,
|
||||
on_attention: true,
|
||||
on_failure: true,
|
||||
on_success: false,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
async fn create(
|
||||
db: &Arc<dyn Database>,
|
||||
@@ -338,13 +348,7 @@ async fn create(
|
||||
max_concurrent: 1,
|
||||
dedup_window: None,
|
||||
},
|
||||
notify: NotifyConfig {
|
||||
channel: notify_channel,
|
||||
user: user_id.to_string(),
|
||||
on_attention: true,
|
||||
on_failure: true,
|
||||
on_success: false,
|
||||
},
|
||||
notify: cli_notify_config(notify_channel),
|
||||
last_run_at: None,
|
||||
next_fire_at: next_fire,
|
||||
run_count: 0,
|
||||
@@ -729,4 +733,14 @@ mod tests {
|
||||
// Must be valid UTF-8 (would have panicked otherwise).
|
||||
assert!(result.is_char_boundary(result.len()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cli_notify_config_defaults_to_runtime_target_resolution() {
|
||||
let notify = cli_notify_config(Some("telegram".to_string()));
|
||||
assert_eq!(notify.channel.as_deref(), Some("telegram")); // safety: test-only assertion
|
||||
assert_eq!(notify.user, None); // safety: test-only assertion
|
||||
assert!(notify.on_attention); // safety: test-only assertion
|
||||
assert!(notify.on_failure); // safety: test-only assertion
|
||||
assert!(!notify.on_success); // safety: test-only assertion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user