fix(lint): ruff auto-fix + lewooogo-core src 加入 git
- Python: ruff --fix 修復 280 個 lint 錯誤 - lewooogo-core: src/ 目錄未追蹤,導致 CI eslint 失敗 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ Features:
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
from uuid import uuid4
|
||||
@@ -63,7 +63,7 @@ class AgentOpinion(BaseModel):
|
||||
kubectl_command: str | None = None
|
||||
priority: int = Field(default=5, ge=1, le=10, description="優先度 1-10, 10 最高")
|
||||
estimated_impact: dict[str, Any] = Field(default_factory=dict)
|
||||
created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|
||||
|
||||
model_config = {"use_enum_values": False}
|
||||
|
||||
@@ -124,7 +124,7 @@ class ConsensusResult(BaseModel):
|
||||
final_reasoning: str
|
||||
risk_level: str
|
||||
dissenting_opinions: list[str] = Field(default_factory=list)
|
||||
created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|
||||
|
||||
model_config = {"use_enum_values": False}
|
||||
|
||||
@@ -382,7 +382,7 @@ class ConsensusEngine:
|
||||
agent.analyze(incident),
|
||||
timeout=timeout_sec / len(self._agents),
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
logger.warning(
|
||||
"agent_analyze_timeout",
|
||||
agent_type=agent.agent_type.value,
|
||||
@@ -511,7 +511,7 @@ class ConsensusEngine:
|
||||
|
||||
整合所有專家意見,產生結構化的 ConsensusResult
|
||||
"""
|
||||
consensus_id = f"CON-{datetime.now(timezone.utc).strftime('%Y%m%d')}-{uuid4().hex[:8].upper()}"
|
||||
consensus_id = f"CON-{datetime.now(UTC).strftime('%Y%m%d')}-{uuid4().hex[:8].upper()}"
|
||||
|
||||
# 找出最佳的 kubectl 指令 (來自最高 priority + confidence 的意見)
|
||||
best_kubectl = None
|
||||
|
||||
Reference in New Issue
Block a user