Format the current state for the no-args branch.
()
| 762 | pass |
| 763 | |
| 764 | def _render_status() -> str: |
| 765 | """Format the current state for the no-args branch.""" |
| 766 | if not current_advisor or not current_provider: |
| 767 | # Either field missing → effectively unset. Show what's |
| 768 | # there (if anything) so users can fix a partial config. |
| 769 | partial = "" |
| 770 | if current_advisor and not current_provider: |
| 771 | partial = ( |
| 772 | f"\n(Found advisor_model={current_advisor!r} but no " |
| 773 | "advisor_provider — clear with /advisor unset then " |
| 774 | "re-run with the explicit syntax.)" |
| 775 | ) |
| 776 | elif current_provider and not current_advisor: |
| 777 | partial = ( |
| 778 | f"\n(Found advisor_provider={current_provider!r} but " |
| 779 | "no advisor_model — clear with /advisor unset.)" |
| 780 | ) |
| 781 | # Critic C1: surface advisor_client_mode even on partial |
| 782 | # configs so the user sees stored state that would silently |
| 783 | # activate as soon as both fields land. |
| 784 | if current_client_mode: |
| 785 | partial += ( |
| 786 | "\n(advisor_client_mode is ON but won't engage " |
| 787 | "until both advisor_model and advisor_provider " |
| 788 | "are set.)" |
| 789 | ) |
| 790 | providers = _list_configured_providers() |
| 791 | providers_hint = ( |
| 792 | f"Configured providers: {', '.join(providers)}.\n" |
| 793 | if providers else "" |
| 794 | ) |
| 795 | return ( |
| 796 | "Advisor: not set\n" |
| 797 | f"{providers_hint}" |
| 798 | "Use \"/advisor <provider>:<model>\" to enable, e.g.:\n" |
| 799 | ' /advisor anthropic:claude-opus-4-7 (direct Anthropic)\n' |
| 800 | ' /advisor openai:claude-opus-4-7 (via openai-compat, ' |
| 801 | 'e.g. litellm)\n' |
| 802 | ' /advisor openrouter:anthropic/claude-opus-4.1' |
| 803 | f"{partial}" |
| 804 | ) |
| 805 | mode = decide_advisor_mode( |
| 806 | provider, |
| 807 | main_loop_model, |
| 808 | current_advisor, |
| 809 | force_client_mode=current_client_mode, |
| 810 | advisor_provider=current_provider, |
| 811 | advisor_enabled=current_enabled, |
| 812 | ) |
| 813 | mode_label = { |
| 814 | ADVISOR_MODE_SERVER_SIDE: "active (server-side)", |
| 815 | ADVISOR_MODE_CLIENT_SIDE: "active (client-side)", |
| 816 | ADVISOR_MODE_INACTIVE: "inactive", |
| 817 | }.get(mode, "inactive") |
| 818 | suffix = "" |
| 819 | if current_client_mode: |
| 820 | suffix = " [--client forced]" |
| 821 | if not current_enabled: |
no test coverage detected