fix: fs tools now output better error handling to guide the model more effectively
This commit is contained in:
@@ -10,5 +10,13 @@ set -e
|
||||
|
||||
main() {
|
||||
# shellcheck disable=SC2154
|
||||
cat "$argc_path" >> "$LLM_OUTPUT" 2>&1 || echo "No such file or path: $argc_path" >> "$LLM_OUTPUT"
|
||||
}
|
||||
local path="$argc_path"
|
||||
|
||||
# An empty result is shown to the model as the opaque literal "DONE"; emit a note instead.
|
||||
if [[ -f "$path" && ! -s "$path" ]]; then
|
||||
echo "(empty file: $path)" >> "$LLM_OUTPUT"
|
||||
return 0
|
||||
fi
|
||||
|
||||
cat "$path" >> "$LLM_OUTPUT" 2>&1 || echo "No such file or path: $path" >> "$LLM_OUTPUT"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user