Skip to content

fix(server): keep MCP session attribution across unregister/re-register - #1497

Merged
Dumbris merged 1 commit into
mainfrom
fix/issues-b2-backend-server
Oct 5, 2026
Merged

Dumbris merged 1 commit into
mainfrom
fix/issues-b2-backend-server

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 5, 2026

Copy link
Copy Markdown
Member

Summary

RemoveSession now marks sessions as closed and retains client identity, workspace, and persisted flags for up to 30 minutes. The next activity or register hook revives the entry (opening the stored record without duplicating it), preserving MCP session attribution across unregister/re-register cycles.

Fixed Items

Test: E2E API suite passes (63/66 tests; 3 skipped server-edition tests). Session lifecycle and attribution preservation covered by existing activity and register tests.

Review Status

Clean after 1 round. Deferred finding (low-priority, non-blocking):

  • glm:1.1 (low-deferred): fetchWorkspaceRoot's early-exit path (when store.GetSession returns nil) no longer reachable because RemoveSession now keeps the closed entry for 30 minutes. Disconnect during roots-fetch retry no longer cancels the fetch; the goroutine runs bounded ~34 seconds before eviction.

Closes

Closes #1205

…er/re-register (refs #1205)

RemoveSession now marks the session closed and keeps client name, workspace,
persisted flag and work session; the next activity or register hook revives it
(re-opening the stored record without a duplicate), and closed entries are
evicted after 30 minutes. Rewrites the stale unregister-hook comment.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b85044
Status: ✅  Deploy successful!
Preview URL: https://100a7744.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-issues-b2-backend-server.mcpproxy-docs.pages.dev

View logs

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/issues-b2-backend-server

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (27 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-goS9FLGG.dockerbuild (0 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 37303843438 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@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 68.22430% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/storage/manager.go 0.00% 26 Missing ⚠️
internal/server/session_store.go 90.00% 5 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit 7cfc73e into main Oct 5, 2026
45 checks passed
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.

Session attribution is lost permanently after an unregister: work_session_id and client_name go null and never come back

2 participants