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: validate label IDs in ha_manage_entity_labels to prevent silent failures (#486)
* fix: validate label IDs in ha_manage_entity_labels to prevent silent failures
Add validation to ha_manage_entity_labels that checks if all label IDs exist
before attempting assignment. This prevents the silent failure bug where the
tool would report success but fail to apply non-existent labels AND hide all
existing labels in the UI.
Changes:
- Add label ID validation before entity operations in ha_manage_entity_labels
- Fetch available labels from label registry via WebSocket
- Return clear error message listing non-existent label IDs
- Provide helpful suggestions to use ha_config_get_label() or ha_config_set_label()
- Add comprehensive E2E tests for label validation scenarios
Fixes#475
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: improve robustness of label validation
Address Gemini Code Assist review suggestions:
- Add type checking for label list items to prevent AttributeError
- Improve test assertions to verify exact invalid label lists
- Ensure both helper tool suggestions are validated in tests
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments