MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _write_advisor_client_mode

Function _write_advisor_client_mode

src/command_system/builtins.py:622–640  ·  view source on GitHub ↗

Persist advisor_client_mode (store-preferred, settings fallback). Mirrors ``_write_advisor_model`` — same dual-path persistence.

(context: CommandContext, value: bool)

Source from the content-addressed store, hash-verified

620
621
622def _write_advisor_client_mode(context: CommandContext, value: bool) -> None:
623 """Persist advisor_client_mode (store-preferred, settings fallback).
624 Mirrors ``_write_advisor_model`` — same dual-path persistence."""
625 store = getattr(context, "app_state_store", None)
626 if store is not None:
627 from ..state.app_state import replace_state
628 store.set_state(lambda s: replace_state(s, advisor_client_mode=bool(value)))
629 return
630 from .. import config as cfg_mod
631 from ..settings.settings import invalidate_settings_cache
632 mgr = cfg_mod._get_default_manager()
633 cfg = mgr.load_global()
634 settings_section = cfg.get("settings")
635 if not isinstance(settings_section, dict):
636 settings_section = {}
637 settings_section["advisor_client_mode"] = bool(value)
638 cfg["settings"] = settings_section
639 mgr.save_global(cfg)
640 invalidate_settings_cache()
641
642
643def _read_current_advisor_enabled(context: CommandContext) -> bool:

Callers 1

advisor_command_callFunction · 0.85

Calls 6

replace_stateFunction · 0.85
set_stateMethod · 0.45
load_globalMethod · 0.45
getMethod · 0.45
save_globalMethod · 0.45

Tested by

no test coverage detected