feat(api): 統一使用台北時區 UTC+8 (禁止 UTC)

- 新增 src/utils/timezone.py 時區工具函式
- 修改 11 個後端檔案,全部改用 now_taipei()
- 更新 HARD_RULES.md 加入時區鐵律章節
- 更新 Skills 02/04 加入時區禁令

🔴 HARD RULE: 禁止 datetime.utcnow() / datetime.now(UTC)
 正確做法: from src.utils.timezone import now_taipei

Memory: feedback_timezone_taipei.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-25 09:08:34 +08:00
parent 5f3271174f
commit 2a2dac865a
14 changed files with 276 additions and 49 deletions

View File

@@ -8,10 +8,15 @@ AWOOOI API - Sentry Webhook Handler
2. 組裝錯誤上下文
3. 呼叫 OpenClaw Error Analyzer Agent
4. 結果回寫 Sentry Issue Comment
5. 發送 Telegram 告警 (含截圖)
6. 建立 Approval 供人工審核
🔴 HARD RULE: 時間顯示使用 Asia/Taipei (UTC+8)
"""
import logging
from datetime import datetime
from src.utils.timezone import now_taipei, now_taipei_iso
import httpx
from fastapi import APIRouter, BackgroundTasks, HTTPException, Request
@@ -227,7 +232,7 @@ async def post_sentry_comment(
{analysis.prevention}
---
*分析信心度: {analysis.confidence:.0%} | 分析時間: {datetime.now().isoformat()}*
*分析信心度: {analysis.confidence:.0%} | 分析時間: {now_taipei_iso()}*
"""
try: