Commit 9c301d7
fix(tools_integrations): adopt three Gemini findings on PR #1424
F1 + F2: drop redundant logger.error calls in _delete_direct_entry's
HomeAssistantAPIError-non-404 branch and Exception fallback branch.
exception_to_structured_error emits a structured ToolError carrying
the right ErrorCode + message but deliberately does NOT log at ERROR
for classified failures — by design in helpers.py (only
ErrorCode.INTERNAL_ERROR triggers logger.exception there, to avoid
duplicate ERROR-log noise on classified failures). The local
logger.error therefore duplicated the information surface that the
structured ToolError already carries and went against the design
intent.
F3: add entry_id, entity_ids, require_restart keys to Path 4 (config
subentry) idempotent return shape so it matches the schema used by
the Path 1/2/3 idempotent returns. Callers that branch on these
fields (e.g. to determine whether HA needs a restart, or to enumerate
removed entity_ids) now see a consistent contract across all four
idempotent branches.
Net change: -2 / +3 lines in src/ha_mcp/tools/tools_integrations.py.
74 unit tests pass unchanged across test_tools_integrations.py (52) +
test_config_subentries_folded.py (22).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3cb4fd7 commit 9c301d7
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
1386 | | - | |
1387 | 1386 | | |
1388 | 1387 | | |
1389 | 1388 | | |
| |||
1393 | 1392 | | |
1394 | 1393 | | |
1395 | 1394 | | |
1396 | | - | |
1397 | 1395 | | |
1398 | 1396 | | |
1399 | 1397 | | |
| |||
1658 | 1656 | | |
1659 | 1657 | | |
1660 | 1658 | | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1661 | 1662 | | |
1662 | 1663 | | |
1663 | 1664 | | |
| |||
0 commit comments