Skip to content

Commit ae21d96

Browse files
authored
Merge pull request #1905 from derekmisler/fix/triage-result-parsing
Replace the brittle tail -n 1 parsing with something that searches for the marker
2 parents c586766 + fbdb3fb commit ae21d96

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/auto-issue-triage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ jobs:
109109
cat "$OUTPUT_FILE"
110110
echo "--------------------"
111111
112-
# The agent contract requires the result marker on the last line
113-
LAST_LINE=$(tail -n 1 "$OUTPUT_FILE" | tr -d '[:space:]')
114-
if [[ "$LAST_LINE" == "RESULT:NEEDS_INFO" ]]; then
112+
# Search for the result marker anywhere in the output (LLMs often add trailing empty lines)
113+
RESULT=$(grep -oE 'RESULT:(NEEDS_INFO|FIXED|NO_CHANGES)' "$OUTPUT_FILE" | tail -n 1)
114+
if [[ "$RESULT" == "RESULT:NEEDS_INFO" ]]; then
115115
echo "action=needs_info" >> "$GITHUB_OUTPUT"
116-
elif [[ "$LAST_LINE" == "RESULT:FIXED" ]]; then
116+
elif [[ "$RESULT" == "RESULT:FIXED" ]]; then
117117
echo "action=fixed" >> "$GITHUB_OUTPUT"
118-
elif [[ "$LAST_LINE" == "RESULT:NO_CHANGES" ]]; then
118+
elif [[ "$RESULT" == "RESULT:NO_CHANGES" ]]; then
119119
echo "action=none" >> "$GITHUB_OUTPUT"
120120
else
121-
echo "::warning::No recognized result marker on last line: $LAST_LINE"
121+
echo "::warning::No recognized result marker found in agent output"
122122
echo "action=none" >> "$GITHUB_OUTPUT"
123123
fi
124124

0 commit comments

Comments
 (0)