fix: Telegram bot 全功能修復 — 16個await按鈕/AI對話/模型遷移/DB schema
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s
## Telegram Bot 功能修復 - 補全 16 個 await: 按鈕的 handler(日期選擇/目標設定/促銷追蹤等), 新增 _handle_await_callback + _process_await_input 完整狀態機 - cmd: 按鈕加入 ⏳ 即時回饋 + try/except 防 BadRequest - handle_callback 加頂層 try/except 錯誤兜底 - 補 momo:cmd:suggestion + momo:menu:main callback handler - 修復 _enhanced_keyword_matching context NameError ## AI 模型遷移(hermes3@111 → qwen2.5@188) - hermes_analyst_service: URL 192.168.0.111→188, hermes3→qwen2.5:7b-instruct - code_review_pipeline: 改用 HERMES_URL/HERMES_MODEL 常數 - elephant_alpha_orchestrator / nemoton_dispatcher: registry/footprint 同步 - aider_heal_executor: OLLAMA_API_BASE fallback 改 188 - ai_routes: footprint display 字串改 qwen2.5:7b-instruct ## ElephantAlpha 404 修復 - elephant_service: openrouter→NVIDIA NIM, nvidia/llama-3.1-nemotron-ultra-253b-v1 - ai_provider: 模型 ID 同步更新 ## TELEGRAM_CHAT_ID 環境變數修正 - cicd_routes + aider_heal_executor: 優先讀 TELEGRAM_CHAT_IDS[0], fallback TELEGRAM_CHAT_ID,修復通知靜默失敗 ## AI 對話 logging 改善 - telegram_ai_integration: Hermes 降級改 WARNING,OpenClaw 失敗加 exc_info - hermes_analyst_service: 連線失敗 log 加 host/model context ## DB Schema 修復 - migrations/019: action_plans 補齊全欄位,DROP NOT NULL action_type - autoheal_models: ActionPlan ORM 同步為超集 schema Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,22 +28,34 @@ class AgentContext(Base):
|
||||
|
||||
class ActionPlan(Base):
|
||||
"""
|
||||
行動計畫表(NemoTron 輸出,等待審核與執行追蹤)。
|
||||
行動計畫表 — 統一 schema(超集)。
|
||||
Group A(01-init.sql / CodeReview / OpenClaw):
|
||||
action_type, description, priority, metadata_json
|
||||
Group B(migration 017 / watcher_agent / ai_orchestrator):
|
||||
session_id, plan_type, sku, payload, created_by, approved_by, executed_at
|
||||
migration 019 已在 DB 補齊所有欄位。
|
||||
"""
|
||||
__tablename__ = 'action_plans'
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
# Group A columns
|
||||
action_type = Column(String(100), nullable=True) # code_review_fix / openclaw_recommendation
|
||||
description = Column(Text) # 人類可讀的行動說明
|
||||
status = Column(String(50), default='pending') # pending/auto_pending/pending_review/executed
|
||||
priority = Column(Integer, default=3) # 1=critical 2=high 3=medium 4=low
|
||||
metadata_json = Column(Text) # JSON: pipeline_id/commit_sha/findings
|
||||
created_at = Column(DateTime, default=datetime.now)
|
||||
# Group B columns (ADR-012 / NemoTron)
|
||||
session_id = Column(String(64), nullable=True)
|
||||
plan_type = Column(String(50), nullable=True) # price_adjust / restock / campaign
|
||||
sku = Column(String(100), nullable=True, index=True)
|
||||
sku = Column(String(100), nullable=True)
|
||||
payload = Column(Text) # JSON 行動內容
|
||||
status = Column(String(20), default='pending') # pending/approved/rejected/executed
|
||||
created_by = Column(String(50)) # nemotron / openclaw
|
||||
approved_by = Column(String(100), nullable=True) # Telegram user_id
|
||||
created_at = Column(DateTime, default=datetime.now)
|
||||
executed_at = Column(DateTime, nullable=True)
|
||||
|
||||
__table_args__ = (
|
||||
Index('idx_action_plans_type', 'action_type'),
|
||||
Index('idx_action_plan_sku_status', 'sku', 'status'),
|
||||
Index('idx_action_plan_created', 'created_at'),
|
||||
{'extend_existing': True},
|
||||
|
||||
Reference in New Issue
Block a user