Skip to content

Commit 057ad68

Browse files
Print "No files found" in sys.find so LLM can handle empty case better
1 parent b8a97bc commit 057ad68

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/builtin/builtin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ func SysFind(ctx context.Context, env []string, input string) (string, error) {
216216
if err != nil {
217217
return "", nil
218218
}
219+
if len(result) == 0 {
220+
return "No files found", nil
221+
}
222+
219223
sort.Strings(result)
220224
return strings.Join(result, "\n"), nil
221225
}

pkg/loader/github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func getCommit(account, repo, ref string) (string, error) {
4040
SHA string `json:"sha,omitempty"`
4141
}
4242
if err := json.NewDecoder(resp.Body).Decode(&commit); err != nil {
43-
return "", fmt.Errorf("failed to decode GitHub commit of %s/%s at %s: %w", err)
43+
return "", fmt.Errorf("failed to decode GitHub commit of %s/%s at %s: %w", account, repo, url, err)
4444
}
4545

4646
if commit.SHA == "" {

0 commit comments

Comments
 (0)