Skip to content

fix(clients): credit mcp-remote-bridged Claude Desktop and codex-mcp-client sessions - #1799

Merged
Dumbris merged 3 commits into
mainfrom
fix/1786-bridged-client-aliases
Oct 29, 2026
Merged

Dumbris merged 3 commits into
mainfrom
fix/1786-bridged-client-aliases

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 29, 2026

Copy link
Copy Markdown
Member

Summary

Codex CLI and Claude Desktop stayed connected_never_seen after Connect, and their sessions landed in other: rows (one per mcp-remote version), because presence matched clientInfo.name exactly against ClientInfoNames:

  • Codex CLI sends codex-mcp-client, which was not a Codex alias.
  • Claude Desktop through the mcp-remote bridge Connect writes sends claude-ai (via mcp-remote <version>).

Changes

  • clientidentity.AliasCandidate: NormalizeRaw plus removal of one trailing (via mcp-remote <version>) tag. Strict grammar (single spaces, printable parenthesis-free version), and controls are preserved, so an escape- or newline-bearing name still cannot pass as a supported client. Used only for supported-alias lookup; unknown names keep their exact key.
  • Applied at every alias match site: runtime.sanitizeClientName (presence ClientLastSeen), UsageAggregate.applyClientCalls (24h calls), httpapi Clients hub (clientMatches, session other: check), and telemetry activation's client-name sanitizer.
  • Codex gains the codex-mcp-client alias.

Not in scope

  • Pre-upgrade evidence recorded under the bridged name (other:claude-ai (via mcp-remote 0.15.x) rows, usage buckets) is not migrated; it stays as-is and ages out. New sessions are credited correctly.
  • local-agent-mode-mcpproxy (via mcp-remote …) and mcp-remote's mcp-remote-fallback-test probe still appear as other: rows (optional in the issue).

Testing

  • New failing-first tests: AliasCandidate table incl. adversarial control/whitespace cases; RecordClientSeen for bridged + Codex names; usage aggregate crediting; Clients hub end-to-end (claude-desktop/codex rows get last_seen and the active session, no other: rows); escape-prefixed bridged name stays unknown; telemetry sanitizer cases.
  • go test -race for clientidentity, connect, runtime, telemetry, httpapi (CI skip regex): pass.
  • ./scripts/test-api-e2e.sh: 70/70.
  • golangci-lint v2 (.github/.golangci.yml, bare and --build-tags server): no new findings.
  • Cross-model review: opencode gpt-6.1-sol + Claude Opus adversarial reviewer, 3 rounds; round 3 CLEAN.

Closes #1786

🤖 Generated with Claude Code

Dumbris and others added 3 commits October 29, 2026 11:10
…client sessions (#1786)

Presence, the Clients hub and 24h call counts matched clientInfo.name
exactly against ClientInfoNames. Claude Desktop through the mcp-remote
bridge Connect writes sends "claude-ai (via mcp-remote <version>)" and
Codex CLI sends "codex-mcp-client", so both stayed connected_never_seen
and their sessions landed in other: rows, one per mcp-remote version.

clientidentity.AliasCandidate strips one trailing mcp-remote tag before
known-alias lookup; it keeps controls like NormalizeRaw, so an
escape-prefixed name still cannot pass as a supported client, and
unknown names keep their exact key. Codex gains the codex-mcp-client
alias. Stale bridged other: rows from earlier releases are hidden.

Closes #1786

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elemetry parity

Review round 1 (opencode Sol 6.1 + Claude adversarial):
- The bridge tag now needs single-space separators and a printable,
  parenthesis-free version, so newline/control-bearing tags no longer
  strip to a supported alias.
- Stop hiding pre-upgrade bridged other: rows: they were hidden without
  being credited, silently dropping last_seen evidence.
- Telemetry activation's client-name sanitizer reports a bridged client
  as the client behind the bridge, matching presence and usage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t name

Review round 2: re-trimming AliasCandidate's result dropped a tab/newline
before the bridge tag, so telemetry credited a name runtime and httpapi
reject.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: cdd363d
Status: ✅  Deploy successful!
Preview URL: https://e952d1ad.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-1786-bridged-client-alia.mcpproxy-docs.pages.dev

View logs

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/1786-bridged-client-aliases

Available Artifacts

  • archive-darwin-amd64 (32 MB)
  • archive-darwin-arm64 (29 MB)
  • archive-linux-amd64 (20 MB)
  • archive-linux-arm64 (18 MB)
  • archive-windows-amd64 (32 MB)
  • archive-windows-arm64 (28 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (28 MB)
  • installer-dmg-darwin-arm64 (25 MB)
  • smart-mcp-proxymcpproxy-goT5HECV.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 40848780736 --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

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit a8adffc into main Oct 29, 2026
49 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.

[Bug]: Codex CLI and Claude Desktop stuck at "connected, never seen"

2 participants