Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(routing): pin managed skill payloads to LF (#502)

lhzapatabc31f180ec52
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..43646d43
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+# These files are embedded verbatim by include_str!, so checkout EOLs become
+# part of the CLI and MCP payload contract.
+crates/ai-memory-core/src/routing_skills/*/SKILL.md text eol=lf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c355a41c..e22e40de 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.32.2] - 2026-08-26
### Fixed
+- Made managed routing `SKILL.md` payloads byte-identical across release
+ platforms. Windows builds previously embedded CRLF from the runner checkout
+ while Linux and macOS builds embedded LF, so one tag returned different
+ bytes through CLI installs and `memory_install_self_routing`. The embedded
+ assets now use LF everywhere without rewriting user-authored files. (#502)
- The native client now trusts CAs from the platform trust store. It was built
with reqwest's `rustls-tls`, which bundles the Mozilla webpki roots and
ignores the OS store, so a CA the operator had installed locally — Caddy's
diff --git a/README.md b/README.md
index 26766a14..4dbd5ee0 100644
--- a/README.md
+++ b/README.md
@@ -629,6 +629,8 @@ one matching entry.
(`ai-memory install-instructions`, or `--target AGENTS.md` for AGENTS-based
projects) when you want new tool guidance. The refresh writes the slim
markered snippet and managed Agent Skills from the same binary-owned assets.
+ Managed skill payloads use LF line endings on every release platform, while
+ user-authored files keep their existing line endings.
For every client in the [Support Matrix](#support-matrix), plus curl-based hook
installs, source builds, CLI environment variables, and the full subcommand
diff --git a/crates/ai-memory-core/src/routing_skills.rs b/crates/ai-memory-core/src/routing_skills.rs
index f7460505..3671b7ca 100644
--- a/crates/ai-memory-core/src/routing_skills.rs
+++ b/crates/ai-memory-core/src/routing_skills.rs
@@ -146,6 +146,22 @@ mod tests {
}
}
+ #[test]
+ fn managed_skill_payloads_use_lf_line_endings() {
+ for skill in MANAGED_SKILLS {
+ assert!(
+ !skill.content.contains('\r'),
+ "{} must use LF line endings",
+ skill.name
+ );
+ assert!(
+ skill.content.ends_with('\n'),
+ "{} must end with a newline",
+ skill.name
+ );
+ }
+ }
+
#[test]
fn relative_paths_are_safe_relative_skill_markdown_files() {
for skill in MANAGED_SKILLS {
@@ -197,8 +213,7 @@ mod tests {
}
fn parse_frontmatter(skill: &ManagedSkill) -> Frontmatter {
- let content = skill.content.replace("\r\n", "\n");
- let Some(rest) = content.strip_prefix("---\n") else {
+ let Some(rest) = skill.content.strip_prefix("---\n") else {
panic!("{} must start with frontmatter", skill.name);
};
let Some((frontmatter, _body)) = rest.split_once("\n---\n") else {
diff --git a/docs/install.md b/docs/install.md
index 968a2e24..2288baa1 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -1752,6 +1752,9 @@ with the slim snippet, leaves unrelated instructions before and after it alone,
and writes a timestamped `.bak-*` backup before changing an existing file.
Managed skill files contain an ai-memory ownership marker; same-name user skills
without that marker are preserved unless you explicitly force replacement.
+Their embedded payloads use LF line endings on every release platform, so CLI
+installs and `memory_install_self_routing` return the same bytes on Windows,
+Linux, and macOS. This does not rewrite line endings in user-authored files.
`install-instructions --print` previews only the instruction snippet; run
`install-skills --print` when you want to preview the managed skill payloads.