libnyanpasu/clash-nyanpasu · warning
merge value for `{field}` is not a sequence, skipped
Error message
merge value for `{field}` is not a sequence, skipped What it means
In splice_sequence, the merge value supplied for a field must be an array (items to prepend/append to the target field). If the overlay's merge value is not a sequence, the field is left untouched and a warning is logged.
Source
Thrown at backend/nyanpasu-config/src/runtime/executor/overlay.rs:60
config = bare_key_merge(config, key, value);
}
}
config
}
fn strip_any<'a>(key: &'a str, prefixes: &[&str]) -> Option<&'a str> {
prefixes.iter().find_map(|prefix| key.strip_prefix(prefix))
}
fn splice_sequence(
config: ConfigValue,
field: &str,
value: &ConfigValue,
prepend: bool,
logs: &mut Vec<StepLogEntry>,
) -> ConfigValue {
let Some(to_merge) = value.as_array_arc() else {
logs.push(StepLogEntry::warn(format!(
"merge value for `{field}` is not a sequence, skipped"
)));
return config;
};
let segments = parse_dotted_path(field);
let Some(target) = get_at(&config, &segments) else {
logs.push(StepLogEntry::warn(format!(
"field `{field}` not found, skipped"
)));
return config;
};
let Some(existing) = target.as_array_arc() else {
logs.push(StepLogEntry::warn(format!(
"field `{field}` is not a sequence, skipped"
)));
return config;
};
View on GitHub (pinned to f7dbce2997)
Solutions
- Wrap the merge value in a YAML/JSON list, even for a single item
- Validate overlay merge values are arrays before applying
- Check the field name in the warning to locate the offending overlay entry
- Use `set`/override semantics instead of prepend/append if a scalar value is intended
Example fix
# before
rules:
prepend: MATCH,DIRECT
# after
rules:
prepend:
- MATCH,DIRECT Defensive patterns
Strategy: validation
Validate before calling
fn merge_values_are_arrays(overlay: &ConfigValue) -> bool {
overlay.as_object_arc().map_or(false, |m| m.iter().all(|(_, v)|
v.get("prepend").map_or(true, |x| x.as_array_arc().is_some()) &&
v.get("append").map_or(true, |x| x.as_array_arc().is_some())))
} Try / catch
let Some(to_merge) = value.as_array_arc() else {
return Err(anyhow!("merge value for `{field}` must be a sequence"));
}; Prevention
- Always wrap merge values in a list, even for a single item
- Use override/set semantics for scalar values instead of prepend/append
- Lint overlay documents for non-array prepend/append values
When it happens
Trigger: apply_overlay → splice_sequence: the overlay entry's value for `{field}` (with prepend/append merge) is a mapping or scalar instead of a list, so value.as_array_arc() returns None.
Common situations: Overlay rule like `rules: {prepend: MATCH,DIRECT}` where the value is a string instead of a list; writing `prepend: {...}` with an object; copy-pasting a single rule without wrapping it in a list.
Related errors
- overlay document is not a mapping, skipped
- invalid remove entry, skipped
- unrecognized typed config migration state: existing {} is ne
- unsupported migration store schema version {}
- profiles.yaml failed validation: {errors:?}
AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08).
Data as JSON: /api/errors/8999091ed1f57492.
Report an issue: GitHub.