jdx/mise · error
task input group cycle
Error message
task {task_name} input group cycle: {} What it means
A task's inputs reference an input group in a way that forms a cycle: expanding group A requires group B which (transitively) requires A again. mise reports the full cycle path to help locate the loop.
Solutions
- Break the cycle: remove the group reference that loops back (the cycle path in the message shows the loop: A -> B -> A)
- If the group should be a leaf, replace its group reference with concrete input paths
- Deduplicate shared inputs into a separate group that both A and B reference instead of referencing each other
Example fix
// before [input_groups] all = ["group:build"] build = ["group:all"] // after [input_groups] all = ["group:build", "docs/**"] build = ["src/**/*.rs"]
Defensive patterns
Strategy: validation
Validate before calling
// pre-validate input group graph for cycles before expansion (DFS)
fn has_cycle(groups: &HashMap<String, Vec<String>>) -> bool {
fn dfs(g: &str, groups: &HashMap<String, Vec<String>>, stack: &mut Vec<String>) -> bool {
if stack.contains(&g.to_string()) { return true; }
stack.push(g.to_string());
for dep in groups.get(g).into_iter().flatten() {
if let Some(next) = dep.strip_prefix("group:") {
if dfs(next, groups, stack) { return true; }
}
}
stack.pop();
false
}
groups.keys().any(|k| dfs(k, groups, &mut vec![]))
} Type guard
// Rust
fn is_group_ref(entry: &str) -> Option<&str> {
entry.strip_prefix("group:")
} Try / catch
// Rust
match expand_task_inputs(...) {
Ok(inputs) => use(inputs),
Err(e) if e.to_string().contains("input group cycle") => {
eprintln!("break the loop shown in the message (A -> B -> A)");
}
Err(e) => return Err(e),
} Prevention
- Draw the input-group dependency graph when defining nested groups
- Never let a group reference itself directly or transitively
- Put shared inputs into a common leaf group instead of cross-referencing groups
When it happens
Trigger: During task input expansion (expand_task_inputs) when walking input_groups, the group being entered is already present in the stack — e.g. group "all" includes "build" which includes "all". Groups can also be undefined, but this specific error fires only on a genuine cycle.
Common situations: Refactoring task inputs where group A was changed to depend on group B while B already depended on A; copy-pasting group definitions creating self-references (a group including itself).
Related errors
- bootstrap resource ' ' depends on missing resource
- Cycle detected in tool overrides
- workspace project depends on unknown project
- workspace project cannot both add and remove dependency
- a provided source resolves to a path
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/1b8a2d4969f77979.
Report an issue: GitHub.
Appendix: source
Thrown at src/config/mod.rs:3817
anchor_literals: bool,
) -> Result<Vec<String>> {
let mut expanded = vec![];
for entry in entries {
let Some(group) = entry.strip_prefix(TASK_INPUT_GROUP_PREFIX) else {
expanded.push(if anchor_literals {
anchor_task_input(root, entry)
} else {
entry.clone()
});
continue;
};
let (inputs, group_root) = task_inputs.input_groups.get(group).ok_or_else(|| {
eyre!("task {task_name} references undefined input group {group:?} with {entry:?}")
})?;
if let Some(cycle_start) = stack.iter().position(|name| name == group) {
let mut cycle = stack[cycle_start..].to_vec();
cycle.push(group.to_string());
bail!(
"task {task_name} input group cycle: {}",
cycle.iter().join(" -> ")
);
}
stack.push(group.to_string());
expanded.extend(expand_task_inputs(
inputs,
task_inputs,
group_root,
task_name,
stack,
true,
)?);
stack.pop();
}
Ok(expanded)
}
View on GitHub (pinned to 533346cc37)