mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(backend): Ensure database manager clients only include methods needed for their contexts (#10717)
The database manager had both sync and async clients that contained overlapping methods, including some that weren't actually used in their respective contexts. This violated the principle that each client should only expose the methods it needs. ## Problem The `DatabaseManagerClient` (sync) included `get_user_execution_summary_data`, but this method was only ever used in async contexts like the notifications system. This created unnecessary coupling and violated the design goal of having focused, context-specific clients. ## Solution After comprehensive analysis of actual method usage across the codebase: - **Removed** `get_user_execution_summary_data` from `DatabaseManagerClient` since it's only used in async contexts (notifications) - **Verified** all remaining methods on both clients are actively used in their respective contexts: - Sync client (11 methods): Used in monitoring and main execution thread - Async client (26 methods): Used in node execution, blocks, and notifications - **Maintained** the base `DatabaseManager` class with the union of all methods needed by either client ## Impact Each client now contains exactly the methods it needs for its specific usage patterns: - `DatabaseManagerClient` handles synchronous operations like monitoring and credit management - `DatabaseManagerAsyncClient` handles asynchronous operations like node execution, persistence, and notifications The change is minimal and surgical - only removing one unused method while preserving all actually-used functionality. Fixes #10658. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/Significant-Gravitas/AutoGPT/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Swifty <craigswift13@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ntindle <8845353+ntindle@users.noreply.github.com> Co-authored-by: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Reinier van der Leer <pwuts@agpt.co> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Nicholas Tindle <nicktindle@outlook.com> Co-authored-by: Bently <Github@bentlybro.com>
This commit is contained in: