fix: enforce LF for .py hook files to fix #507

CRLF line endings in .claude hook files caused claude-code SessionStart
hooks to fail silently on Windows checkouts — python3 received a filename
ending in '\r' (e.g. 'session-start-context.py\r'), failed with ENOENT,
and the claude-code query short-circuited with result='' across every
A2A call. Observed symptom: all 22 agents returned '(no response
generated)' on every pulse despite the model never being called
(input_tokens=0, output_tokens=0).

Existing *.sh rule covered the shebang line; adding *.py covers the
Python hook target that the shell script invokes. Shipped alongside
the same fix in molecule-ai-plugin-molecule-session-context (which
is the primary source of these hooks via the platform plugin loader).

Fixes #507

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rabbitblood 2026-04-16 13:18:17 -07:00
parent e76aee6022
commit 995f51f950

6
.gitattributes vendored
View File

@ -3,6 +3,12 @@
*.sh text eol=lf
workspace-template/entrypoint.sh text eol=lf
# Python hook files are invoked by .sh hooks with path substitution;
# CRLF in either the .sh OR the .py file breaks the hook dispatch.
# See Molecule-AI/molecule-core#507 — SessionStart hook failed silently,
# agents returned "(no response generated)" on every A2A call.
*.py text eol=lf
# Dockerfiles and compose files are parsed by tools that tolerate CRLF,
# but keep LF for consistency across platforms.
Dockerfile text eol=lf