Skip to content

feat(storage): GC orphaned tool-approval records on config load (MCP-1002) - #584

Merged
Dumbris merged 1 commit into
mainfrom
feat/mcp-1002-orphan-approval-gc
Jun 4, 2026
Merged

feat(storage): GC orphaned tool-approval records on config load (MCP-1002)#584
Dumbris merged 1 commit into
mainfrom
feat/mcp-1002-orphan-approval-gc

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 4, 2026

Copy link
Copy Markdown
Member

Orphan tool-approval GC (MCP-1002, part 1)

Prunes tool_approvals records whose server is no longer in the configured set, on LoadConfiguredServers. 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 via DeleteServerToolApprovals).

  • storage.PruneToolApprovalsNotIn(keep) + Manager.PruneOrphanToolApprovals(configuredServers)
  • Hooked into runtime.LoadConfiguredServers
  • Unit tests: prune orphans, preserve disabled, empty-config, no-orphans.

Scope 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.

…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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 67.56757% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/storage/bbolt.go 63.63% 4 Missing and 4 partials ⚠️
internal/runtime/lifecycle.go 50.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/mcp-1002-orphan-approval-gc

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (24 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 26928669615 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit 3b9a477 into main Jun 4, 2026
28 checks passed
@Dumbris
Dumbris deleted the feat/mcp-1002-orphan-approval-gc branch June 4, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants