fix(db): delegate get/set_full_capabilities onto DatabaseManager facade (#1200)#1214
Open
dolho wants to merge 1 commit into
Open
fix(db): delegate get/set_full_capabilities onto DatabaseManager facade (#1200)#1214dolho wants to merge 1 commit into
dolho wants to merge 1 commit into
Conversation
…de (#1200) GET/PUT /api/agents/{name}/capabilities 500'd with `AttributeError: 'DatabaseManager' object has no attribute 'get_full_capabilities'`. The #1093 db decomposition added explicit pass-throughs for most agent settings but missed the full-capabilities pair — the methods live on SecurityMixin (composed into AgentOperations / self._agent_ops) but had no delegating method on the facade the routers call. Add the two pass-throughs alongside the read-only delegations, and remove them from the test_database_facade_delegation KNOWN_FACADE_GAPS allowlist so the static guard now enforces them. Add an explicit #1200 regression check. Related to #1200. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Resolve by running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GETandPUT /api/agents/{name}/capabilitiesboth return HTTP 500 since the #1093 SQLAlchemy-Core db decomposition (v0.6.1):get_full_capabilities/set_full_capabilitieslive onSecurityMixin(composed intoAgentOperations, i.e.db._agent_ops) but were never given a delegating pass-through on theDatabaseManagerfacade the routers call. So an agent's full-capabilities setting can be neither read nor changed via API/UI. Backend-independent (pure facade gap; SQLite + PostgreSQL).Fix
Add the two pass-throughs on
DatabaseManager, alongside the existing read-only delegations (src/backend/database.py):The
SecurityMixinimplementations already exist — this purely restores the facade passthrough.Tests
tests/unit/test_database_facade_delegation.pyalready whitelisted these two names inKNOWN_FACADE_GAPS. Removed them so the AST-based static guard now actively enforces the delegation, and added an explicittest_1200_capabilities_methods_delegatedregression check.Sweep (per issue note)
Swept every method on the
AgentOperationsmixins for un-delegated facade gaps. Only the two capabilities methods are both missing and called asdb.<m>(...).is_agent_shared_with_emailis also un-delegated but has 0db.call sites (latent, not a live 500) — left out of scope. The otherKNOWN_FACADE_GAPSentries are pre-existing, unrelated to #1200.Related to #1200. Sibling #1093 regression: #1199.
🤖 Generated with Claude Code