fix(ci): mypy 三处类型修正(lastrowid 直赋 / json.loads 收窄 / 移除失效 ignore)

This commit is contained in:
GitHub
2026-09-02 20:30:35 +08:00
parent a9dabe4682
commit 06b5d380d5
3 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -244,7 +244,8 @@ def _post_json(
)
try:
with urllib.request.urlopen(req, timeout=timeout) as resp:
return json.loads(resp.read().decode("utf-8"))
data: dict[str, Any] = json.loads(resp.read().decode("utf-8"))
return data
except urllib.error.HTTPError as exc:
body = exc.read().decode("utf-8", errors="replace")[:500]
raise LlmError(f"LLM API HTTP {exc.code}: {body}", status=exc.code) from exc
+1 -1
View File
@@ -133,7 +133,7 @@ class LlmHistoryStore:
rec.end_date,
),
)
rec.id = int(cur.lastrowid)
rec.id = cur.lastrowid
return rec
def list_all(self, limit: int = 50) -> list[LlmHistoryRecord]:
+1 -1
View File
@@ -111,7 +111,7 @@ async def get_llm_config() -> dict[str, Any]:
if preset.needs_key and not cfg.api_key:
missing.append("api_key")
except ValueError as exc:
resolved = cfg # type: ignore[assignment]
resolved = cfg
missing = [str(exc)]
return {
"config": cfg.to_dict(mask_api_key=True),