MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / trackSessionStarted

Method trackSessionStarted

packages/node-sdk/src/kimi-harness.ts:258–278  ·  view source on GitHub ↗
(
    eventSessionId: string,
    resumed: boolean,
    sessionScoped?: TelemetryProperties,
  )

Source from the content-addressed store, hash-verified

256 }
257
258 private trackSessionStarted(
259 eventSessionId: string,
260 resumed: boolean,
261 sessionScoped?: TelemetryProperties,
262 ): void {
263 withTelemetryContext(this.telemetry, { sessionId: eventSessionId }).track('session_started', {
264 ...this.sessionStartedProperties,
265 ...sessionScoped,
266 // Canonical fields are owned by the harness and must win over any
267 // caller-supplied sessionStartedProperties that happen to share a key.
268 // `client_id` is always null here: a single-process host has no
269 // per-connection client id (that concept only exists for daemon clients,
270 // see core-impl.ts). Kept as an explicit key so both producers share the
271 // same session_started schema.
272 client_id: null,
273 client_name: this.identity?.userAgentProduct ?? null,
274 client_version: this.identity?.version ?? null,
275 ui_mode: this.uiMode,
276 resumed,
277 });
278 }
279}
280
281const DEFAULT_SESSION_STARTED_UI_MODE = 'shell';

Callers 4

createSessionMethod · 0.95
resumeSessionMethod · 0.95
reloadSessionMethod · 0.95
forkSessionMethod · 0.95

Calls 2

withTelemetryContextFunction · 0.90
trackMethod · 0.65

Tested by

no test coverage detected