Skip to content

Commit 8ea467a

Browse files
htillyclaude
andcommitted
fix: Correct malformed curl payload in AICODE preprocessing workflow
- Fixed broken sed piping syntax on curl command - Added missing variable declarations (REQUESTER, CHANNEL, TIMESTAMP, RUN_ID) - Removed duplicate curl commands - Simplified to single curl using properly constructed jq payload - Removed redundant Slack notification step This fixes the critical issue preventing the preprocessing workflow from properly dispatching to the main agent workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3d050b5 commit 8ea467a

1 file changed

Lines changed: 7 additions & 35 deletions

File tree

.github/workflows/aicode-preprocess.yml

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ jobs:
6060
run: |
6161
ENHANCED_TASK="${{ steps.preprocess.outputs.enhanced_task }}"
6262
ORIGINAL_TASK="${{ github.event.client_payload.task }}"
63-
63+
REQUESTER="${{ github.event.client_payload.requester }}"
64+
CHANNEL="${{ github.event.client_payload.channel }}"
65+
TIMESTAMP="${{ github.event.client_payload.timestamp }}"
66+
RUN_ID="${{ github.run_id }}"
67+
6468
# Use jq to properly construct JSON payload with proper escaping
6569
PAYLOAD=$(jq -n \
6670
--arg event_type "aicode-enhanced" \
@@ -81,41 +85,9 @@ jobs:
8185
preprocessing_run_id: $preprocessing_run_id
8286
}
8387
}')
84-
85-
curl -X POST "https://api.github.com/repos/${{ github.repository }}/dispatches" \
86-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
87-
-H "Accept: application/vnd.github+json" \
88-
-H "Content-Type: application/json" \
89-
-d "$PAYLOAD" 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
90-
ORIGINAL_TASK_ESCAPED=$(echo "$ORIGINAL_TASK" | sed 's/"/\\"/g')
91-
88+
9289
curl -X POST "https://api.github.com/repos/${{ github.repository }}/dispatches" \
9390
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
9491
-H "Accept: application/vnd.github+json" \
9592
-H "Content-Type: application/json" \
96-
-d "{
97-
\"event_type\": \"aicode-enhanced\",
98-
\"client_payload\": {
99-
\"task\": \"$ENHANCED_TASK_ESCAPED\",
100-
\"original_task\": \"$ORIGINAL_TASK_ESCAPED\",
101-
\"requester\": \"${{ github.event.client_payload.requester }}\",
102-
\"channel\": \"${{ github.event.client_payload.channel }}\",
103-
\"timestamp\": \"${{ github.event.client_payload.timestamp }}\",
104-
\"preprocessing_run_id\": \"${{ github.run_id }}\"
105-
}
106-
}"
107-
108-
- name: Notify Slack on preprocessing completion
109-
if: always()
110-
run: |
111-
if [ "${{ steps.preprocess.outcome }}" == "success" ]; then
112-
curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
113-
-H "Content-Type: application/json" \
114-
-d "{\"text\":\"📝 Task preprocessed and enhanced. Triggering code generation...\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"📝 *Task Preprocessing Complete*\\n\\n*Original:* ${{ github.event.client_payload.task }}\\n\\n*Enhanced:* ${{ steps.preprocess.outputs.enhanced_task }}\"}}]}"
115-
else
116-
curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
117-
-H "Content-Type: application/json" \
118-
-d "{\"text\":\"⚠️ Preprocessing failed, using original task\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ *Preprocessing Warning*\\n\\nPreprocessing failed, but code generation will continue with original task.\"}}]}"
119-
fi
120-
env:
121-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
93+
-d "$PAYLOAD"

0 commit comments

Comments
 (0)