Skip to content

Commit 733bccf

Browse files
committed
fix: resolve mypy strict errors for AIConfig | None union types
1 parent c9747af commit 733bccf

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

plugins/mcp-server-sqlseed/src/mcp_server_sqlseed/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def sqlseed_gemma4_analyze(
238238
ai_config, err = _build_ai_config(db_path, model, backend)
239239
if err is not None:
240240
return err
241+
assert ai_config is not None # guaranteed by err check above
241242

242243
with DataOrchestrator(db_path) as orch:
243244
_validate_table_name(table_name, orch.get_table_names())
@@ -280,6 +281,7 @@ def sqlseed_gemma4_agent_fill(
280281
ai_config, err = _build_ai_config(db_path, model, backend)
281282
if err is not None:
282283
return err
284+
assert ai_config is not None # guaranteed by err check above
283285

284286
# Step 1: AI analysis with self-correction
285287
analyzer = SchemaAnalyzer(config=ai_config)

plugins/sqlseed-ai/src/sqlseed_ai/analyzer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ def _find_local_fallback_model(
265265
not just the first one. Returns the actual local model ID if found,
266266
or None if no suitable fallback exists.
267267
"""
268-
all_local = self._config._detect_all_local_models()
268+
config = self._config
269+
assert config is not None, "AIConfig must be initialized before checking local fallback"
270+
all_local = config._detect_all_local_models()
269271
if not all_local:
270272
return None
271273

@@ -287,7 +289,7 @@ def _find_local_fallback_model(
287289
return None
288290

289291
# Walk the fallback chain and find the first available local model
290-
candidate = next_model
292+
candidate: str | None = next_model
291293
while candidate is not None:
292294
cand_norm = _normalize_model_id(candidate)
293295
if cand_norm in local_map:

0 commit comments

Comments
 (0)