daemon: configurable LLM concurrency

New config field "llm_concurrency" (default 1) controls how many
concurrent model calls the daemon runs. Worker pool scales to match.
This commit is contained in:
ProofOfConcept 2026-03-05 22:56:16 -05:00
parent 1f9249a767
commit a9b0438c74
2 changed files with 11 additions and 6 deletions

View file

@ -49,6 +49,8 @@ pub struct Config {
pub journal_max: usize,
/// Ordered context groups for session-start loading.
pub context_groups: Vec<ContextGroup>,
/// Max concurrent LLM calls in the daemon.
pub llm_concurrency: usize,
/// Separate Claude config dir for background agent work (daemon jobs).
/// If set, passed as CLAUDE_CONFIG_DIR so the daemon authenticates
/// with different OAuth credentials than the interactive session.
@ -73,6 +75,7 @@ impl Default for Config {
source: ContextSource::Store,
},
],
llm_concurrency: 1,
agent_config_dir: None,
}
}
@ -127,6 +130,9 @@ impl Config {
if let Some(m) = cfg.get("journal_max").and_then(|v| v.as_u64()) {
config.journal_max = m as usize;
}
if let Some(n) = cfg.get("llm_concurrency").and_then(|v| v.as_u64()) {
config.llm_concurrency = n.max(1) as usize;
}
if let Some(s) = cfg.get("agent_config_dir").and_then(|v| v.as_str()) {
config.agent_config_dir = Some(expand_home(s));
}