mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:13:19 +08:00
Specialists-only binding/prewarm/MCP allowlists fold legacy manager aliases into generalist; stop persisting confirm/plan prefs and strip inherit from prompt signatures. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from runtime import direct_loop as dl
|
|
|
|
|
|
class _DummyStore:
|
|
def __init__(self, settings: dict[str, str] | None = None):
|
|
self.settings = dict(settings or {})
|
|
|
|
def get_setting(self, key: str) -> str:
|
|
return str(self.settings.get(key, ""))
|
|
|
|
|
|
def test_tool_wire_freeze_default_on(monkeypatch) -> None:
|
|
monkeypatch.setattr(dl, "_prepare_llm_tools", lambda **kwargs: [])
|
|
monkeypatch.setenv("AIA_TOOL_WIRE_FROZEN_ON_STARTUP", "")
|
|
store = _DummyStore()
|
|
_ = dl.warm_tool_wire_cache(store=store, tools=object(), base_url="", roles=["generalist"])
|
|
st = dl.tool_wire_freeze_status(store=store)
|
|
assert st["enabled"] is True
|
|
assert st["frozen"] is True
|
|
|
|
|
|
def test_tool_wire_freeze_disabled_by_setting(monkeypatch) -> None:
|
|
monkeypatch.setattr(dl, "_prepare_llm_tools", lambda **kwargs: [])
|
|
store = _DummyStore({"AIA_TOOL_WIRE_FROZEN_ON_STARTUP": "0"})
|
|
_ = dl.warm_tool_wire_cache(store=store, tools=object(), base_url="", roles=["generalist"])
|
|
st = dl.tool_wire_freeze_status(store=store)
|
|
assert st["enabled"] is False
|
|
assert st["frozen"] is False
|