From cfe2ce624a2562b015550bdb48d334d13a4277c1 Mon Sep 17 00:00:00 2001 From: zbl1998-sdjn <1051061805@qq.com> Date: Sat, 30 May 2026 00:15:27 +1000 Subject: [PATCH] chore: normalize line endings to LF via .gitattributes The repository has no `.gitattributes`, so with Git for Windows' default `core.autocrlf=true`, source files check out as CRLF on Windows. This includes the raw-text prompt/skill `.md` files imported as model input (e.g. `packages/agent-core/src/tools/builtin/file/read.ts` does `import readDescriptionTemplate from './read.md'`). A contributor editing and committing such a file on Windows can silently introduce CRLF, which changes the shipped prompt's byte/token footprint. Add `* text=auto eol=lf` (plus explicit `binary` types) so the repository stores and checks out LF on every platform, regardless of a contributor's local `core.autocrlf`. Existing blobs are already LF, so this is a declarative change with no content churn. --- .gitattributes | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..0a2b5396 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,20 @@ +# Normalize line endings to LF in the repository for all text files. +# Without this, Windows checkouts (core.autocrlf=true) introduce CRLF into +# source and raw-text prompt/skill `.md` files that are loaded as model +# input, which inflates token/byte counts and breaks snapshot tests. +* text=auto eol=lf + +# Explicit binary types (never normalize) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.webp binary +*.woff binary +*.woff2 binary +*.ttf binary +*.otf binary +*.mp4 binary +*.mov binary +*.pdf binary