fix: apply runtime telemetry settings to web and remote clients

DS Web and remote Agent launch paths omitted shared telemetry opt-out settings. Reuse one environment definition for local launches, remote runtime profiles, and the remote model bridge helper while preserving existing update controls and user-requested networking.

Validation: 16 focused tests passed at commit time. Prior local real-model validation passed; modified Agent real-Host validation and background network monitoring remain outstanding.

Release note: 补齐 DS Web 与远程 Runtime 启动时的遥测关闭配置,保留现有自动更新关闭设置,不影响模型、MCP 和用户主动联网请求。
This commit is contained in:
mesalogo
2026-09-27 13:57:26 +08:00
parent 8b15399577
commit eb53c827c6
7 changed files with 30 additions and 17 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import { canonicalJson } from '../../shared/agent-protocol/canonical'
import type { ResolvedModelProfile } from '../runtime-settings-store'
import { createManagedModelBridge } from '../remote-agent/managed-model-bridge'
import { terminateProcessTreeAndWait } from './child-process-termination'
import { buildCredentialFilteredUserEnvironment } from './process-environment'
import { buildCredentialFilteredUserEnvironment, runtimePrivacyEnvironment } from './process-environment'
import { nativeDshMcpToolName, nativeDshWebPatch, nativeDshWebPolicySource, type NativeDshMcpServer } from './native-dsh-web-policy'
export type { NativeDshMcpServer } from './native-dsh-web-policy'
@@ -177,7 +177,7 @@ export class NativeDshWebClientService {
instance.child = spawn(launch.nodeExecutablePath, [cli, 'web', '--no-open', '--host', '127.0.0.1', '--port', '0'], {
cwd: request.workspace, shell: false, windowsHide: true,
detached: process.platform !== 'win32', stdio: ['ignore', 'pipe', 'pipe'],
env: { ...environment, DSH_HOME: instance.home, DSH_TELEMETRY_DISABLED: '1',
env: { ...environment, ...runtimePrivacyEnvironment, DSH_HOME: instance.home, DSH_TELEMETRY_DISABLED: '1',
DSH_PERMISSION_MODE: 'danger-full-access', GOODBUDDY_DSH_MODEL_KEY: MODEL_BRIDGE_SDK_AUTH_SENTINEL }
})
const child = instance.child
+3 -14
View File
@@ -1,3 +1,6 @@
import { runtimePrivacyEnvironment } from '../../shared/runtime-privacy-environment'
export { runtimePrivacyEnvironment } from '../../shared/runtime-privacy-environment'
import type { LaunchEnvironmentProvider } from '../local-tool-environment/launch-environment-provider'
export const runtimeProviderEnvironmentNames = [
@@ -112,20 +115,6 @@ export type RuntimeProfileCredential = {
value: string
}
export const runtimePrivacyEnvironment: NodeJS.ProcessEnv = {
DO_NOT_TRACK: '1',
OTEL_EXPORTER_OTLP_ENDPOINT: '',
OTEL_EXPORTER_OTLP_HEADERS: '',
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '',
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '',
OTEL_LOGS_EXPORTER: 'none',
OTEL_LOG_USER_PROMPTS: '0',
OTEL_METRICS_EXPORTER: 'none',
OTEL_SDK_DISABLED: 'true',
OTEL_TRACES_EXPORTER: 'none'
}
export function buildRuntimeEnvironment(
overrides: NodeJS.ProcessEnv,
source: NodeJS.ProcessEnv = process.env