Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/backend/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ def get_read_only_mode(self, agent_name: str):
def set_read_only_mode(self, agent_name: str, enabled: bool, config: dict = None):
return self._agent_ops.set_read_only_mode(agent_name, enabled, config)

def get_full_capabilities(self, agent_name: str) -> bool:
return self._agent_ops.get_full_capabilities(agent_name)

def set_full_capabilities(self, agent_name: str, enabled: bool) -> bool:
return self._agent_ops.set_full_capabilities(agent_name, enabled)

# =========================================================================
# Agent Guardrails (GUARD-001)
# =========================================================================
Expand Down
18 changes: 16 additions & 2 deletions tests/unit/test_database_facade_delegation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
"get_agent_last_activity",
"get_agent_permissions",
"get_agent_schedules",
"get_full_capabilities",
"set_full_capabilities",
"update_business_status",
}
)
Expand Down Expand Up @@ -137,3 +135,19 @@ def test_webhook_001_methods_delegated():
f"WEBHOOK-001 methods missing from DatabaseManager: {sorted(missing)}. "
"Add pass-through methods that delegate to self._schedule_ops."
)


def test_1200_capabilities_methods_delegated():
"""Regression check for #1200: the full-capabilities pair must be delegated
on DatabaseManager. They exist on SecurityMixin (composed into
AgentOperations) but the #1093 db decomposition forgot the facade
pass-through, so GET/PUT /api/agents/{name}/capabilities 500'd with
AttributeError.
"""
methods = _databasemanager_methods()
required = {"get_full_capabilities", "set_full_capabilities"}
missing = required - methods
assert not missing, (
f"capabilities methods missing from DatabaseManager: {sorted(missing)}. "
"Add pass-through methods that delegate to self._agent_ops."
)
Loading