feat(storage): GC orphaned tool-approval records on config load (MCP-1002) - #584
Merged
Conversation
…1002) Prune tool-approval records whose server is no longer in the configured set. Configured-but-disabled servers are preserved so re-enabling never re-quarantines their previously-approved tools. Hooked into LoadConfiguredServers, guarded against a transient empty config nuking every approval. Scope note: the config.db size problem (investigated under MCP-1002) is NOT free-page bloat — it is unbounded growth of activity_records (~438MB / ~93k rows) and security scan reports (~231MB). That needs a retention policy, handled separately; compaction alone is insufficient and is intentionally not included here.
Deploying mcpproxy-docs with
|
| Latest commit: |
e59d15e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9b37067e.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-mcp-1002-orphan-approva.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 26928669615 --repo smart-mcp-proxy/mcpproxy-go
|
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.
Orphan tool-approval GC (MCP-1002, part 1)
Prunes
tool_approvalsrecords whose server is no longer in the configured set, onLoadConfiguredServers. Configured-but-disabled servers are preserved so re-enabling never re-quarantines previously-approved tools. Guarded against a transient empty config nuking every approval (explicit server deletion already cleans up viaDeleteServerToolApprovals).storage.PruneToolApprovalsNotIn(keep)+Manager.PruneOrphanToolApprovals(configuredServers)runtime.LoadConfiguredServersScope note (the bigger finding)
The config.db size problem investigated under MCP-1002 is not free-page bloat or orphans (only 24 orphan records). It's unbounded growth of
activity_records(~438 MB / ~93k rows) and security scan reports (~231 MB). That needs a retention policy — handled in a separate follow-up (in progress). This PR is the small, clean orphan-GC part.Refs MCP-1002.