SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]
Enh: Warn if scrolling >= 3 times (#626)
Kilian Lieret97da745e9488
diff --git a/config/commands/defaults.sh b/config/commands/defaults.shindex 226942a2..19916b8e 100644--- a/config/commands/defaults.sh+++ b/config/commands/defaults.sh@@ -120,6 +120,15 @@ goto() {_print}+_scroll_warning_message() {+ local current_scroll_count=${SCROLL_COUNT:-0}+ export SCROLL_COUNT=$((current_scroll_count + 1))+ if [ $SCROLL_COUNT -gt 2 ]; then+ echo "Warning: You have scrolled $SCROLL_COUNT times. This is very inefficient."+ echo "If you know what you are looking for, use \`search_file <pattern>\` instead."+ fi+}+# @yaml# signature: scroll_down# docstring: moves the window down {WINDOW} lines@@ -132,6 +141,7 @@ scroll_down() {export CURRENT_LINE=$(jq -n "$CURRENT_LINE + $WINDOW - $OVERLAP")_constrain_line_print+ _scroll_warning_message}# @yaml@@ -146,6 +156,7 @@ scroll_up() {export CURRENT_LINE=$(jq -n "$CURRENT_LINE - $WINDOW + $OVERLAP")_constrain_line_print+ _scroll_warning_message}# @yaml