You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: handle service call timeouts gracefully and add missing @log_tool usage (fixes#550) (#555)
* fix: handle service call timeouts gracefully and add missing @log_tool_usage
Service calls like update.install are inherently asynchronous and can
timeout without indicating failure. Previously, timeouts were reported
as CONNECTION_TIMEOUT errors even when the service was dispatched
successfully. Now, timeout errors from service calls return a partial
success response guiding the user to check entity state.
Also adds the missing @log_tool_usage decorator to all tools in
tools_service.py (ha_call_service, ha_get_operation_status,
ha_bulk_control, ha_get_bulk_status) for proper call logging.
Closes#550https://claude.ai/code/session_017sxnmZqDVwxtqs8BesvxRP
* refactor: address Gemini review - type check for timeout, DRY suggestions
- Use isinstance(error.__cause__, httpx.TimeoutException) instead of
string matching on error messages for more robust timeout detection
- Extract _build_service_suggestions() helper to deduplicate the
suggestion list used in both exception handlers
https://claude.ai/code/session_017sxnmZqDVwxtqs8BesvxRP
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments