Skip to content

Commit 7d1b876

Browse files
committed
feat: add validation and logging for unsupported LLM config override keys
1 parent 560250a commit 7d1b876

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

minitap/mobile_use/config.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,19 @@ def get_default_minitap_llm_config() -> LLMConfig | None:
244244

245245

246246
def deep_merge_llm_config(default: LLMConfig, override: dict) -> LLMConfig:
247-
def _deep_merge_dict(base: dict, extra: dict):
247+
def _deep_merge_dict(base: dict, extra: dict, path: str = ""):
248248
for key, value in extra.items():
249-
if isinstance(value, dict):
250-
_deep_merge_dict(base[key], value)
249+
current_path = f"{path}.{key}" if path else key
250+
251+
if key not in base:
252+
logger.warning(
253+
f"Unsupported config key '{current_path}' found in override config. "
254+
f"Ignoring this key."
255+
)
256+
continue
257+
258+
if isinstance(value, dict) and isinstance(base[key], dict):
259+
_deep_merge_dict(base[key], value, current_path)
251260
else:
252261
base[key] = value
253262

0 commit comments

Comments
 (0)