Skip to content

fix(cli): the lefthook trailer job aidd telemetry prints fails on Windows #999

Closed as not planned

Description

@blafourcade

Description

aidd telemetry on, in a repository whose prepare-commit-msg belongs to lefthook, prints a job for the user to add to lefthook.yml (sessionTrailerLefthookJob in cli/src/contexts/telemetry/domain/formats/commit-session-trailer.ts). That job's run contains double quotes:

run: |
  delegate="$(git rev-parse --git-common-dir)/hooks/aidd-session-trailer.sh"
  if [ -f "$delegate" ]; then sh "$delegate" {1} {2}; fi

On Windows, lefthook 2.1.14 runs a job as "sh.exe" -c "<script>" and escapes nothing (#948). A double quote followed by a space truncates the script, so every commit fails with -c: line N: syntax error. #998 fixed this repository's own lefthook.yml; the snippet the CLI gives users still has the same defect.

Expected behaviour

The job the CLI prints runs on Windows, as it does on macOS and Linux, and aidd telemetry still recognises it. It finds the job by looking for aidd-session-trailer.sh in the text of lefthook.yml (cli/src/runtime/git/git-adapter.ts).

Notes

  • fix(lefthook): run the pre-commit on Windows #998 gives the shape: no double quote in any run, with the lookup in a script that the run line names. A user's repository has no scripts/session-trailer-delegate.sh, though, so the CLI must decide where that script lives, for example beside the delegate in the hooks directory.
  • The Husky line (sessionTrailerHuskyLine) is a plain shell file and is not affected.

Activity

  1. added theissue type on Oct 12, 2026
  2. blafourcade commented on Oct 15, 2026

    @blafourcade
    ContributorAuthor

    Superseded by #993: the commit-trailer job is gone, telemetry no longer touches lefthook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions