File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments