Skip to content

Commit 32b17ae

Browse files
committed
more robust resolver script
1 parent 09019a6 commit 32b17ae

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

scripts/resolver_10609.sh

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
set -e
22

3-
export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"
4-
3+
OH_DIR="$(dirname "$0")/.."
54
if [[ -z "$TMP_DIR" ]]; then
65
TMP_DIR="/tmp"
76
fi
7+
8+
export DEBUG=1
9+
export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"
10+
11+
OUTPUT_DIR="$TMP_DIR/resolver-output"
12+
OUTPUT_FILE="$OUTPUT_DIR/output.jsonl"
13+
14+
ISSUE_NUMBER=15
15+
ISSUE_TYPE=issue
16+
817
LOG_FILE="$TMP_DIR/tmp.log"
918

1019
if [[ -z "$LLM_API_KEY" ]]; then
@@ -15,15 +24,30 @@ if [[ -z "$LLM_API_KEY" ]]; then
1524
export LLM_API_KEY=$ANTHROPIC_API_KEY
1625
fi
1726

18-
export DEBUG=1
27+
TARGET_REPO="$OUTPUT_DIR/workspace/${ISSUE_TYPE}_${ISSUE_NUMBER}"
28+
29+
rm -f $OUTPUT_FILE
30+
31+
echo "Target repo at: $TARGET_REPO"
32+
33+
# only cd if the directory exists
34+
if [ -d "$TARGET_REPO" ]; then
35+
cd "$TARGET_REPO"
36+
diff=$(git diff)
37+
if [ -n "$diff" ]; then
38+
echo "Make sure that the repo is clean. Current diff:"
39+
echo "$diff"
40+
fi
41+
fi
42+
echo "Logging to \"$LOG_FILE\"..."
1943

20-
echo -e "Logging to \"$LOG_FILE\"\n"
44+
cd "$OH_DIR"
2145

2246
python -m openhands.resolver.resolve_issue \
2347
--repo replayio-public/bench-devtools-10609 \
24-
--issue-number 15 \
25-
--issue-type issue \
48+
--issue-number $ISSUE_NUMBER \
49+
--issue-type $ISSUE_TYPE \
2650
--max-iterations 50 \
2751
--comment-id 2526444494 \
28-
--output-dir "$TMP_DIR/resolver-output" \
52+
--output-dir "$OUTPUT_DIR" \
2953
> "$LOG_FILE" 2>&1

0 commit comments

Comments
 (0)