You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a8adffc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(clients): credit mcp-remote-bridged Claude Desktop and codex-mcp-client sessions (#1799)
## 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](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
require.NotEqual(t, transformedWithSentinelDisplay.PublicID, sentinelDisplayLookalike.PublicID, "a transformed display beginning with the sentinel must not recreate an escaped ordinary ID")
0 commit comments