Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

fix(hooks): make the Cline argv assertion line-ending tolerant

Claude4b3f3aa663e4
diff --git a/cli/beacon/internal/endpoint/hooks/cline_test.go b/cli/beacon/internal/endpoint/hooks/cline_test.go
index 9e522b6f..ab68aabd 100644
--- a/cli/beacon/internal/endpoint/hooks/cline_test.go
+++ b/cli/beacon/internal/endpoint/hooks/cline_test.go
@@ -13,9 +13,14 @@ import (
//
// Parsed back out of the source rather than compared as a string: argv is the whole point of this
// install shape, so the test asserts on the decoded array a host would spawn.
+//
+// The optional carriage return is load-bearing. The plugin source is a checked-in file, and a
+// Windows checkout converts its line endings, so a bare `$` anchor matched on POSIX and failed on
+// Windows -- for a file whose content was byte-for-byte correct. Line endings are not what this
+// test is about.
func clineRenderedArgv(t *testing.T, source string) []string {
t.Helper()
- match := regexp.MustCompile(`(?m)^const beaconArgv: string\[\] = (\[.*\])$`).FindStringSubmatch(source)
+ match := regexp.MustCompile(`(?m)^const beaconArgv: string\[\] = (\[.*?\])\r?$`).FindStringSubmatch(source)
if len(match) != 2 {
t.Fatalf("no beaconArgv assignment in rendered plugin:\n%s", source)
}