# Check if server is running
curl http://localhost:8001/health
# Check ngrok tunnel
curl -s http://localhost:4040/api/tunnels | grep public_url
# Test webhook endpoint
curl -X POST "http://localhost:8001/slack/webhooks/events" \
-H "Content-Type: application/json" \
-d '{"challenge": "test_challenge"}'
# Should return: {"status":"ignored"} or challenge response
Real-time log monitoring:
tail -f server.log | grep -E "(SUCCESS|ERROR|workflow|spatial|intent)"
Step-by-step debugging:
Success: Processing Slack event: app_mention in team XXXX
Failure: Error handling Slack events webhook
Success: Mapped Slack timestamp XXX to position XXX
Failure: 'SpatialEvent' object has no attribute 'position'
Success: SlackResponseHandler.handle_spatial_event called
Failure: Error handling spatial event
Success: intent_classification: action=XXX confidence=X.X
Failure: Error creating intent from spatial event
Success: Category XXX mapped to workflow_type: XXX
Failure: No workflow type found for intent category
Success: ✅ COMPLETE INTEGRATION SUCCESS: XXX -> XXX -> workflow -> response sent
Failure: Error sending Slack response
Symptom: Invalid request signature (401 error)
Fix:
# Temporarily disable in webhook_router.py for testing
# if not await self._verify_slack_signature(request):
# raise HTTPException(...)
Symptom: 'SpatialEvent' object has no attribute 'position'
Root Cause: Passing wrong type to store_mapping()
Fix: Ensure position parameter is SpatialPosition object with .position integer
Symptom: RuntimeWarning: coroutine 'store_mapping' was never awaited
Fix: Add await to all async calls in spatial adapter
Symptom: No workflow type found for intent category: IntentCategory.XXX
Fix: Add mapping in workflow_factory.py:
elif intent.category == IntentCategory.CONVERSATION:
workflow_type = WorkflowType.GENERATE_REPORT
elif intent.category == IntentCategory.LEARNING:
workflow_type = WorkflowType.GENERATE_REPORT
Symptom: Error sending Slack response
Check: Environment variables and Slack app configuration
echo $SLACK_BOT_TOKEN
echo $SLACK_SIGNING_SECRET
curl -X POST "http://localhost:8001/slack/webhooks/events" \
-H "Content-Type: application/json" \
-d '{"challenge": "test_challenge"}'
curl -X POST "http://localhost:8001/slack/webhooks/events" \
-H "Content-Type: application/json" \
-d '{
"type": "event_callback",
"event": {
"type": "app_mention",
"channel": "C1234567890",
"user": "U1234567890",
"text": "@piper-morgan help",
"ts": "1234567890.123456"
},
"team_id": "T1234567890"
}'
curl -X POST "http://localhost:8001/slack/webhooks/events" \
-H "Content-Type: application/json" \
-d '{
"type": "event_callback",
"event": {
"type": "message",
"channel": "C1234567890",
"user": "U1234567890",
"text": "Hello world",
"ts": "1234567890.123456"
},
"team_id": "T1234567890"
}'
Look for log sequence:
Processing Slack event: app_mentionMapped Slack timestamp XXX to position XXXintent_classification: action=XXX confidence=X.XCategory XXX mapped to workflow_type: XXX✅ COMPLETE INTEGRATION SUCCESS: XXX -> XXX -> workflow -> response sentSlack Event → Webhook Router → Spatial Adapter → Response Handler
↓ ↓ ↓ ↓
Event Data → SpatialEvent → Intent → Workflow Result → Slack Response
webhook_router.py signature verificationspatial_adapter.py type handlingresponse_handler.py classificationworkflow_factory.py mappings