Resolve the advisor master switch (reactive store preferred, settings fallback). Mirrors ``_read_current_advisor_client_mode``.
(context: CommandContext)
| 641 | |
| 642 | |
| 643 | def _read_current_advisor_enabled(context: CommandContext) -> bool: |
| 644 | """Resolve the advisor master switch (reactive store preferred, settings |
| 645 | fallback). Mirrors ``_read_current_advisor_client_mode``.""" |
| 646 | store = getattr(context, "app_state_store", None) |
| 647 | if store is not None: |
| 648 | try: |
| 649 | return bool(getattr(store.get_state(), "advisor_enabled", False)) |
| 650 | except Exception: |
| 651 | pass |
| 652 | try: |
| 653 | from ..settings.settings import get_settings |
| 654 | return bool(getattr(get_settings(), "advisor_enabled", False)) |
| 655 | except Exception: |
| 656 | return False |
| 657 | |
| 658 | |
| 659 | def _write_advisor_enabled(context: CommandContext, value: bool) -> None: |
no test coverage detected