Merge remote-tracking branch 'origin/master' into codex/disable-telemetry-default
Resolve three conflicts: - packages/bundle/base/tests/base.spec.ts: keep both assertion sets — this branch's telemetry-otel mode expression and master's subagent rows plus manifest dependencies. - packages/session/session-telemetry-otel/tests/otel.spec.ts: keep master's per-mode sharing disclosure test, but select FULL explicitly instead of relying on an omitted mode, because the default is now DISABLED; the default-construction test keeps asserting disabled delivery and gains a case pinning that an omitted mode reports 'disabled' sharing. - scripts/snapshots/translation-prompt-v4/request-response.expected.json: re-recorded from the merged READMEs rather than hand-merging the embedded document text.
This commit is contained in:
@@ -12,9 +12,9 @@ import { mkdtempSync, rmSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { gunzipSync } from 'node:zlib'
|
||||
import { Context } from 'cordis'
|
||||
import { Context } from '@deepseek-ai/cordis'
|
||||
import { getOrCreateAnonymousUserId } from '@deepseek-ai/dsh-user-id'
|
||||
import Loader from '@cordisjs/plugin-loader'
|
||||
import Loader from '@deepseek-ai/cordis-plugin-loader'
|
||||
import { recordFeedback } from '@deepseek-ai/dsh-command-feedback'
|
||||
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
||||
import TelemetryOtel, { Config, DEFAULT_TELEMETRY_MODE, TelemetryMode } from '../src/index.ts'
|
||||
@@ -368,6 +368,38 @@ describe('TelemetryOtel wire', () => {
|
||||
expect(captures).toEqual([])
|
||||
})
|
||||
|
||||
it('discloses the sharing policy for every mode', async () => {
|
||||
const { url, captures } = await mockCollector()
|
||||
|
||||
const fullCtx = new Context()
|
||||
await fullCtx.plugin(SessionStore)
|
||||
const full = await fullCtx.plugin(TelemetryOtel, { mode: TelemetryMode.FULL, exporter: { url } })
|
||||
expect(fullCtx.telemetry.sharing).toBe('full')
|
||||
await full.dispose()
|
||||
|
||||
const gatedCtx = new Context()
|
||||
await gatedCtx.plugin(SessionStore)
|
||||
const gated = await gatedCtx.plugin(TelemetryOtel, { mode: TelemetryMode.FEEDBACK_ONLY, exporter: { url } })
|
||||
expect(gatedCtx.telemetry.sharing).toBe('feedback-only')
|
||||
await gated.dispose()
|
||||
|
||||
const disabledCtx = new Context()
|
||||
await disabledCtx.plugin(SessionStore)
|
||||
const disabled = await disabledCtx.plugin(TelemetryOtel, { mode: TelemetryMode.DISABLED })
|
||||
expect(disabledCtx.telemetry.sharing).toBe('disabled')
|
||||
await disabled.dispose()
|
||||
|
||||
// An omitted mode is DISABLED, so the default also shares nothing.
|
||||
const defaultCtx = new Context()
|
||||
await defaultCtx.plugin(SessionStore)
|
||||
const defaulted = await defaultCtx.plugin(TelemetryOtel, {})
|
||||
expect(defaultCtx.telemetry.sharing).toBe('disabled')
|
||||
await defaulted.dispose()
|
||||
|
||||
// No record was emitted by any mode, so nothing reached the collector.
|
||||
expect(captures).toEqual([])
|
||||
})
|
||||
|
||||
it('defaults direct construction to disabled delivery', async () => {
|
||||
const { url, captures } = await mockCollector()
|
||||
const ctx = new Context()
|
||||
|
||||
Reference in New Issue
Block a user