mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-10 03:13:29 +08:00
feat: add ecc2 worktree auto-merge policy
This commit is contained in:
@@ -31,6 +31,7 @@ pub struct Config {
|
||||
pub default_agent: String,
|
||||
pub auto_dispatch_unread_handoffs: bool,
|
||||
pub auto_dispatch_limit_per_session: usize,
|
||||
pub auto_merge_ready_worktrees: bool,
|
||||
pub cost_budget_usd: f64,
|
||||
pub token_budget: u64,
|
||||
pub theme: Theme,
|
||||
@@ -57,6 +58,7 @@ impl Default for Config {
|
||||
default_agent: "claude".to_string(),
|
||||
auto_dispatch_unread_handoffs: false,
|
||||
auto_dispatch_limit_per_session: 5,
|
||||
auto_merge_ready_worktrees: false,
|
||||
cost_budget_usd: 10.0,
|
||||
token_budget: 500_000,
|
||||
theme: Theme::Dark,
|
||||
@@ -154,6 +156,10 @@ theme = "Dark"
|
||||
config.auto_dispatch_limit_per_session,
|
||||
defaults.auto_dispatch_limit_per_session
|
||||
);
|
||||
assert_eq!(
|
||||
config.auto_merge_ready_worktrees,
|
||||
defaults.auto_merge_ready_worktrees
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -174,11 +180,12 @@ theme = "Dark"
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn save_round_trips_auto_dispatch_settings() {
|
||||
fn save_round_trips_automation_settings() {
|
||||
let path = std::env::temp_dir().join(format!("ecc2-config-{}.toml", Uuid::new_v4()));
|
||||
let mut config = Config::default();
|
||||
config.auto_dispatch_unread_handoffs = true;
|
||||
config.auto_dispatch_limit_per_session = 9;
|
||||
config.auto_merge_ready_worktrees = true;
|
||||
|
||||
config.save_to_path(&path).unwrap();
|
||||
let content = std::fs::read_to_string(&path).unwrap();
|
||||
@@ -186,6 +193,7 @@ theme = "Dark"
|
||||
|
||||
assert!(loaded.auto_dispatch_unread_handoffs);
|
||||
assert_eq!(loaded.auto_dispatch_limit_per_session, 9);
|
||||
assert!(loaded.auto_merge_ready_worktrees);
|
||||
|
||||
let _ = std::fs::remove_file(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user