Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: Replace heredoc with printf to resolve shell syntax errors

LearningCircuitf247d4a8b658
diff --git a/github/scripts/ai-reviewer.sh b/github/scripts/ai-reviewer.sh
index ff92865be2..34beafda71 100755
--- a/github/scripts/ai-reviewer.sh
+++ b/github/scripts/ai-reviewer.sh
@@ -13,9 +13,8 @@ if [ -z "$DIFF_CONTENT" ] || [ -z "$API_KEY" ]; then
exit 1
fi
-# Create a temporary file with the request
-cat > request.json << EOF
-{
+# Create a temporary file with the request - using printf to avoid heredoc issues
+printf '%s\n' '{
"model": "z-ai/glm-4.6",
"messages": [
{
@@ -24,13 +23,12 @@ cat > request.json << EOF
},
{
"role": "user",
- "content": "Please analyze this code diff comprehensively and respond with JSON:\n\nReview Focus Areas:\n- Security: Look for hardcoded secrets, SQL injection, XSS, authentication issues, input validation problems\n- Performance: Check for inefficient algorithms, N+1 queries, missing indexes, memory issues, blocking operations\n- Code Quality: Evaluate readability, maintainability, proper error handling, naming conventions, documentation\n- Best Practices: Ensure adherence to coding standards, proper patterns, type safety, dead code removal\n\nRespond with this JSON format:\n{\n \"status\": \"pass|fail|warning\",\n \"security_issues\": [\n {\"type\": \"security\", \"file\": \"path\", \"line\": 42, \"message\": \"Security issue description\"}\n ],\n \"performance_issues\": [\n {\"type\": \"performance\", \"file\": \"path\", \"line\": 42, \"message\": \"Performance issue description\"}\n ],\n \"quality_issues\": [\n {\"type\": \"quality\", \"file\": \"path\", \"line\": 42, \"message\": \"Quality issue description\"}\n ],\n \"warnings\": [\n {\"type\": \"general\", \"message\": \"General suggestion for improvement\"}\n ],\n \"suggestions\": [\n {\"type\": \"enhancement\", \"message\": \"Positive recommendation\"}\n ]\n}\n\nStatus logic:\n- \"fail\" = Critical security or performance issues that must be addressed\n- \"warning\" = Important issues that should be addressed but do not block merge\n- \"pass\" = No critical issues found (only suggestions and minor improvements)\n\nCode diff to analyze:\n$DIFF_CONTENT"
+ "content": "Please analyze this code diff comprehensively and respond with JSON:\n\nReview Focus Areas:\n- Security: Look for hardcoded secrets, SQL injection, XSS, authentication issues, input validation problems\n- Performance: Check for inefficient algorithms, N+1 queries, missing indexes, memory issues, blocking operations\n- Code Quality: Evaluate readability, maintainability, proper error handling, naming conventions, documentation\n- Best Practices: Ensure adherence to coding standards, proper patterns, type safety, dead code removal\n\nRespond with this JSON format:\n{\n \"status\": \"pass|fail|warning\",\n \"security_issues\": [\n {\"type\": \"security\", \"file\": \"path\", \"line\": 42, \"message\": \"Security issue description\"}\n ],\n \"performance_issues\": [\n {\"type\": \"performance\", \"file\": \"path\", \"line\": 42, \"message\": \"Performance issue description\"}\n ],\n \"quality_issues\": [\n {\"type\": \"quality\", \"file\": \"path\", \"line\": 42, \"message\": \"Quality issue description\"}\n ],\n \"warnings\": [\n {\"type\": \"general\", \"message\": \"General suggestion for improvement\"}\n ],\n \"suggestions\": [\n {\"type\": \"enhancement\", \"message\": \"Positive recommendation\"}\n ]\n}\n\nStatus logic:\n- \"fail\" = Critical security or performance issues that must be addressed\n- \"warning\" = Important issues that should be addressed but do not block merge\n- \"pass\" = No critical issues found (only suggestions and minor improvements)\n\nCode diff to analyze:\n'"$DIFF_CONTENT"'"
}
],
"temperature": 0.1,
"max_tokens": 2000
-}
-EOF
+}' > request.json
# Make API call to OpenRouter
RESPONSE=$(curl -s -X POST "https://openrouter.ai/api/v1/chat/completions" \