Align local MCP client and OS telemetry dimensions
Local MCP tool events already identify their transport as stdio, but lack the bounded client dimension used by the hosted usage report. CLI OS labels also use Node platform names (darwin, win32) instead of the shared reporting labels.
This adds client only to agent_relay_tool_call, derived from the telemetry singleton's existing harness context: claude-code maps to claude; cursor, chatgpt, muse, codex, and grok retain their names; other/custom values become unknown. It adds no process detection, database query, network request, or event. Existing orchestrator_harness, transport and local account identity behavior remain unchanged. Client labels are inferred context, not verified vendor identity. Other events retain any existing client label.
All CLI captures normalize OS labels centrally, including per-event overrides: darwin → macos, win32 → windows; supported canonical labels remain unchanged and unsupported values become unknown. No raw content or credentials are added.
Validation in an isolated clone based on current origin/main, using a real npm ci --ignore-scripts with workspace resolution checked inside the clone:
node node_modules/vitest/vitest.mjs run packages/cli/src/cli/telemetry/dimensions.test.ts packages/cli/src/cli/telemetry/client.test.ts packages/cli/src/cli/agent-relay-mcp.startup.test.ts— 3 files, 110 tests passed.npm run typecheck— passed, including dependency builds and CLI typecheck.node node_modules/typescript/bin/tsc --noEmit -p packages/cli/tsconfig.json— passed again after the final test assertion.- From
packages/cli:node ../../node_modules/eslint/bin/eslint.js src/cli/telemetry/client.ts src/cli/telemetry/client.test.ts src/cli/telemetry/dimensions.ts src/cli/telemetry/dimensions.test.ts src/cli/telemetry/events.ts— no errors; three existing warnings inclient.ts(two Node compatibility variable names and existing function complexity). git diff --check— passed.- Negative controls: removing central client enrichment causes 3 client tests to fail; removing central OS normalization causes 4 tests to fail. Both mutations were restored.
Companion source PRs: Cloud #5909, Relaycast engine #608, and hosted forwarding #296. The usage/seat tracking contract and limits are recorded in the Cloud source documentation.
This PR remains draft for Will's decision. No merge, package release, deployment or live PostHog coverage claim is authorized. The engine PR separately requires Barry's review. Local identity remains account context from environment/file configuration, distinct from server-verified hosted ownership.
Final CI verification
Head 8e4f2107cff204155f198cf2815b5fa084301321: all 82 checks completed — 74 success, 7 intended skips, 1 neutral; none pending or failing. The PR is mergeable and remains a draft.
The two prior broker timeout scenarios passed their bounded repeats without tracking-source or timeout changes. The original timeout phases remain unknown; evidence and job links. The rebase preserved the newer Minor changelog entry plus this tracking fix; tracking source/test files were unchanged and 110 tests passed again. No merge, release or deployment performed.
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Agent Relay sessions
codexsession01a19950· opened viagh pr create· last active 2026-11-02