Skip to content

Commit 701ec5d

Browse files
broomvaclaude
andcommitted
feat: add hive config extraction and CLI display
Add extract_hive() to the WORKFLOW.md loader to parse hive section from YAML front matter. Add [runtime] and [hive] sections to the `symphony config` CLI display. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 1eb10bd commit 701ec5d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

crates/symphony-config/src/loader.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ pub fn extract_config(def: &WorkflowDefinition) -> ServiceConfig {
174174
config.runtime = extract_runtime(runtime);
175175
}
176176

177+
// Hive
178+
if let Some(hive) = map.get(serde_yaml::Value::String("hive".into())) {
179+
config.hive = extract_hive(hive);
180+
}
181+
177182
config
178183
}
179184

@@ -282,6 +287,40 @@ fn extract_runtime(v: &serde_yaml::Value) -> crate::types::RuntimeConfig {
282287
runtime
283288
}
284289

290+
fn extract_hive(v: &serde_yaml::Value) -> crate::types::HiveConfig {
291+
let mut hive = crate::types::HiveConfig::default();
292+
if let Some(enabled) = v
293+
.as_mapping()
294+
.and_then(|m| m.get(serde_yaml::Value::String("enabled".into())))
295+
.and_then(|v| v.as_bool())
296+
{
297+
hive.enabled = enabled;
298+
}
299+
if let Some(n) = get_u64(v, "agents_per_task") {
300+
hive.agents_per_task = n as u32;
301+
}
302+
if let Some(n) = get_u64(v, "max_generations") {
303+
hive.max_generations = n as u32;
304+
}
305+
if let Some(t) = v
306+
.as_mapping()
307+
.and_then(|m| m.get(serde_yaml::Value::String("convergence_threshold".into())))
308+
.and_then(|v| v.as_f64())
309+
{
310+
hive.convergence_threshold = t;
311+
}
312+
if let Some(n) = get_u64(v, "egri_budget_per_agent") {
313+
hive.egri_budget_per_agent = n as u32;
314+
}
315+
if let Some(s) = get_str(v, "eval_script") {
316+
hive.eval_script = Some(s);
317+
}
318+
if let Some(n) = get_u64(v, "spaces_server_id") {
319+
hive.spaces_server_id = Some(n);
320+
}
321+
hive
322+
}
323+
285324
// YAML value helpers
286325

287326
fn get_str(v: &serde_yaml::Value, key: &str) -> Option<String> {

src/cli/config_cmd.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,31 @@ pub async fn run_config(workflow_path: &Path, format: OutputFormat) -> anyhow::R
9999
println!(" stall_timeout: {}ms", config.codex.stall_timeout_ms);
100100
println!();
101101

102+
println!("[runtime]");
103+
println!(" kind: {}", config.runtime.kind);
104+
println!(" base_url: {}", config.runtime.base_url);
105+
println!();
106+
107+
println!("[hive]");
108+
println!(" enabled: {}", config.hive.enabled);
109+
println!(" agents_per_task:{}", config.hive.agents_per_task);
110+
println!(" max_generations:{}", config.hive.max_generations);
111+
println!(" convergence: {}", config.hive.convergence_threshold);
112+
println!(" egri_budget: {}", config.hive.egri_budget_per_agent);
113+
println!(
114+
" eval_script: {}",
115+
config.hive.eval_script.as_deref().unwrap_or("(none)")
116+
);
117+
println!(
118+
" spaces_server: {}",
119+
config
120+
.hive
121+
.spaces_server_id
122+
.map(|id| id.to_string())
123+
.unwrap_or_else(|| "(none)".into())
124+
);
125+
println!();
126+
102127
println!("[server]");
103128
println!(
104129
" port: {}",

0 commit comments

Comments
 (0)