fix: align Grok hooks with official contracts

This commit is contained in:
ZacharyZhang-NY committed 2026-07-20 06:07:52 -04:00
1 parent c60b46b994
commit f71db95502
19 files changed
+2241 -641

No files matched your search

+8
View File
@@ -63,6 +63,14 @@ func prepareSourceChange(
if !existed {
original = nil
}
if !remove && int64(len(next)) > maxManagedSourceBytes {
return nil, fmt.Errorf(
"%s exceeds %d bytes: %s",
label,
maxManagedSourceBytes,
filePath,
)
}
snapshot, err := readManagedFile(filePath, label, maxManagedSourceBytes)
if err != nil {
return nil, err