From 5b6bebdcb7da46d1471b3aeacb28b54ba905b3b2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 19 Jan 2026 15:15:18 +0100 Subject: pkg/aflow: add BadCallError The error allows tools to communicate that an error is not an infrastructure error that must fail the whole workflow, but rather a bad tool invocation by an LLM (e.g. asking for a non-existent file contents). Previously in the codesearcher tool we used a separate Missing bool to communicate that. With the error everything just becomes cleaner and nicer. The errors also allows all other tools to communicate any errors to the LLM when the normal results cannot be provided and don't make sense. --- pkg/codesearch/testdata/query-def-source-missing | 2 +- pkg/codesearch/testdata/query-dir-index-escaping | 2 +- pkg/codesearch/testdata/query-dir-index-file | 2 +- pkg/codesearch/testdata/query-dir-index-missing | 2 +- pkg/codesearch/testdata/query-file-index-missing | 2 +- pkg/codesearch/testdata/query-read-file-dir | 2 +- pkg/codesearch/testdata/query-read-file-escaping | 2 +- pkg/codesearch/testdata/query-read-file-missing | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/codesearch/testdata') diff --git a/pkg/codesearch/testdata/query-def-source-missing b/pkg/codesearch/testdata/query-def-source-missing index 0b60003c7..dcb8c4d75 100644 --- a/pkg/codesearch/testdata/query-def-source-missing +++ b/pkg/codesearch/testdata/query-def-source-missing @@ -1,3 +1,3 @@ def-source source0.c some_non_existent_function no -not found +requested entity does not exist diff --git a/pkg/codesearch/testdata/query-dir-index-escaping b/pkg/codesearch/testdata/query-dir-index-escaping index fd7b55ff0..f57f0eb82 100644 --- a/pkg/codesearch/testdata/query-dir-index-escaping +++ b/pkg/codesearch/testdata/query-dir-index-escaping @@ -1,3 +1,3 @@ dir-index mm/../../ -not found +path is outside of the source tree diff --git a/pkg/codesearch/testdata/query-dir-index-file b/pkg/codesearch/testdata/query-dir-index-file index eecd67d67..a519fad18 100644 --- a/pkg/codesearch/testdata/query-dir-index-file +++ b/pkg/codesearch/testdata/query-dir-index-file @@ -1,3 +1,3 @@ dir-index source0.c -not found +the path is not a directory diff --git a/pkg/codesearch/testdata/query-dir-index-missing b/pkg/codesearch/testdata/query-dir-index-missing index e028d1be1..102ddbdab 100644 --- a/pkg/codesearch/testdata/query-dir-index-missing +++ b/pkg/codesearch/testdata/query-dir-index-missing @@ -1,3 +1,3 @@ dir-index mm/foobar -not found +the directory does not exist diff --git a/pkg/codesearch/testdata/query-file-index-missing b/pkg/codesearch/testdata/query-file-index-missing index 1be486378..803a66377 100644 --- a/pkg/codesearch/testdata/query-file-index-missing +++ b/pkg/codesearch/testdata/query-file-index-missing @@ -1,3 +1,3 @@ file-index some-non-existent-file.c -not found +the file does not exist diff --git a/pkg/codesearch/testdata/query-read-file-dir b/pkg/codesearch/testdata/query-read-file-dir index 210a326cd..b5008e010 100644 --- a/pkg/codesearch/testdata/query-read-file-dir +++ b/pkg/codesearch/testdata/query-read-file-dir @@ -1,3 +1,3 @@ read-file mm -not found +the file is a directory diff --git a/pkg/codesearch/testdata/query-read-file-escaping b/pkg/codesearch/testdata/query-read-file-escaping index fca2abf6a..ba5d544c2 100644 --- a/pkg/codesearch/testdata/query-read-file-escaping +++ b/pkg/codesearch/testdata/query-read-file-escaping @@ -1,3 +1,3 @@ read-file mm/../../codesearch.go -not found +path is outside of the source tree diff --git a/pkg/codesearch/testdata/query-read-file-missing b/pkg/codesearch/testdata/query-read-file-missing index ac7bead8d..adaff1616 100644 --- a/pkg/codesearch/testdata/query-read-file-missing +++ b/pkg/codesearch/testdata/query-read-file-missing @@ -1,3 +1,3 @@ read-file file-that-does-not-exist.c -not found +the file does not exist -- cgit mrf-deployment