)]}'
{
  "commit": "c3ecabb720cbf3fa7bf1372ec8ed449f0b9a4b91",
  "tree": "dc3cbb30ff7f291acfc1522bd0302bf0c0ba4adb",
  "parents": [
    "e08c7ffc8f1ec0cd3899d2fedad79f408b6dc2f9"
  ],
  "author": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Fri Jun 06 22:29:03 2025 +0000"
  },
  "committer": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Fri Jun 06 21:09:32 2025 -0700"
  },
  "message": "github: fix discord webhook payload truncation for long commit messages\n\nFix Discord webhook failures caused by overly long commit body content\nthat exceeds Discord embed size limits, preventing notification delivery.\n\nProblem Analysis:\nDiscord webhooks were failing with HTTP 400 errors when commit messages\ncontained extensive body content. The error response {\"embeds\": [\"0\"]}\nindicated the first embed was invalid, typically due to field length\nviolations. Discord enforces strict limits on embed field sizes:\n- Title: 256 characters maximum\n- Description: 4096 characters maximum\n- Field values: 1024 characters maximum\n\nLarge commits with detailed implementation notes, problem analysis, and\ntechnical documentation were exceeding these limits, causing webhook\ndelivery failures and missed commit notifications.\n\nImplementation Changes:\n\n1. Text Truncation Function:\n   - Added truncate_text() with intelligent content preservation\n   - Attempts truncation at paragraph boundaries (double newlines)\n   - Falls back to sentence boundaries (periods with spaces)\n   - Uses ellipsis (...) to indicate truncated content\n   - Ensures truncation only when more than half content remains\n\n2. Field Length Management:\n   - Title truncated to 256 character Discord limit\n   - Description conservatively limited to 2000 characters for safety\n   - Maintains existing field structure and formatting\n   - Preserves commit author and URL fields unchanged\n\n3. Debug Information:\n   - Added payload size reporting in test mode\n   - Character count logging for title and description fields\n   - Enhanced troubleshooting capabilities for future issues\n\n4. Backward Compatibility:\n   - No changes to function signatures or environment variables\n   - Existing webhook URLs and configuration remain unchanged\n   - Short commit messages pass through unmodified\n   - All existing functionality preserved\n\nTechnical Details:\n- Truncation uses string slicing with boundary detection\n- Conservative 2000 character limit provides buffer below Discord\u0027s 4096 limit\n- Test mode provides detailed payload analysis for debugging\n- JSON payload generation unchanged except for field content\n\nBenefits:\n- Reliable Discord notification delivery for all commit types\n- Intelligent content preservation maintains readability\n- Debug capabilities improve webhook troubleshooting\n- Zero configuration changes required for existing setups\n\nTesting:\n- Verified fix resolves HTTP 400 errors for problematic commit e08c7ffc\n- Confirmed short commit messages remain unaffected\n- Tested intelligent truncation at paragraph and sentence boundaries\n- Validated payload size reduction maintains Discord compatibility\n\nThis fix ensures consistent Discord webhook delivery while preserving\nessential commit information through intelligent content truncation.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s1859815462496f8ak\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b73b5d2c7b42c17e4a672371ffdf4431d7ff3bcb",
      "old_mode": 33261,
      "old_path": ".github/scripts/discord_notify.py",
      "new_id": "2a794c564477f1730879651485b10e1104a660c6",
      "new_mode": 33261,
      "new_path": ".github/scripts/discord_notify.py"
    }
  ]
}
