@@ -104,31 +104,15 @@ jobs:
104104 exit 1
105105 fi
106106
107- # Check if response is JSON (starts with {) or text format
108- if [[ "$RESPONSE" == {* ]]; then
109- # JSON response (likely error)
110- echo "Got JSON response (likely error):"
111- echo "$RESPONSE" | jq || echo "$RESPONSE"
112-
113- # Verify it's a valid response with attempts
114- if echo "$RESPONSE" | jq -e '.attempts' > /dev/null; then
115- echo "Compilation couldn't be fixed, but response format is valid"
116- else
117- echo "Invalid error response format"
118- exit 1
119- fi
120- else
121- # Text response (success case)
122- # Verify the response format has filename markers
123- if ! echo "$RESPONSE" | grep -q "\[filename:"; then
124- echo "Response does not contain filename markers:"
125- echo "$RESPONSE" | jq || echo "$RESPONSE"
126- exit 1
127- fi
128-
129- echo "Compile and fix successful! Response contains code files in text format."
107+ # Check for success in response
108+ if ! echo "$RESPONSE" | jq -e '.success == true' > /dev/null; then
109+ echo "Compilation failed:"
130110 echo "$RESPONSE" | jq || echo "$RESPONSE"
111+ exit 1
131112 fi
113+
114+ echo "Compilation successful!"
115+ echo "$RESPONSE" | jq || echo "$RESPONSE"
132116
133117 - name : Test /generate endpoint
134118 run : |
@@ -248,22 +232,14 @@ jobs:
248232 # Save response to file for later use
249233 echo "$RESPONSE" > generate_output.txt
250234
251- # Verify the response format has filename markers
252- if ! echo "$RESPONSE" | grep -q "\[filename:"; then
253- echo "Response does not contain filename markers:"
254- echo "$RESPONSE" | head -20
235+ # Check for success in response
236+ if ! echo "$RESPONSE" | jq -e '.success == true' > /dev/null; then
237+ echo "Generation failed:"
255238 echo "status=error" >> $GITHUB_OUTPUT
239+ echo "$RESPONSE" | jq || echo "$RESPONSE"
256240 exit 1
257241 fi
258242
259- # Check if this is a fallback template
260- if echo "$RESPONSE" | grep -q "THIS IS A FALLBACK TEMPLATE - LLM generation failed"; then
261- echo "WARNING: Response contains fallback template - LLM generation failed"
262- echo "status=fallback" >> $GITHUB_OUTPUT
263- # Exit with status 0 to allow workflow to continue, but we know it's a fallback
264- exit 0
265- fi
266-
267243 echo "Generate-sync successful! Response contains code files in text format."
268244 echo "status=success" >> $GITHUB_OUTPUT
269245 echo "$RESPONSE" | jq || echo "$RESPONSE"
0 commit comments