Title: refactor: extract telemetry into separate module with enable/disable toggle by Lellansin · Pull Request #130 · lessweb/deepcode-cli · GitHub
Open Graph Title: refactor: extract telemetry into separate module with enable/disable toggle by Lellansin · Pull Request #130 · lessweb/deepcode-cli
X Title: refactor: extract telemetry into separate module with enable/disable toggle by Lellansin · Pull Request #130 · lessweb/deepcode-cli
Description: 变更内容 创建 src/common/telemetry.ts,将 telemetry 上报逻辑从 session.ts 中拆分为独立模块 新增 telemetryEnabled 配置项,支持通过 settings.json 或环境变量控制匿名使用数据上报的开关(默认 true,opt-out) DeepcodingSettings / ResolvedDeepcodingSettings / CreateOpenAIClient 类型中补入 telemetryEnabled 字段 配置解析优先级:系统环境变量 > 项目 env > 项目 settings > 用户 env > 用户 settings > 默认 true session.ts 中 reportNewPrompt() 从 20 行内联代码缩减为 3 行委托调用 背景 当前 telemetry 上报逻辑硬编码在 session.ts 中(URL、超时、请求体),且没有关闭开关。用户无法选择是否参与匿名使用数据上报。 本次改动: 将上报逻辑提取为独立、可测试的模块 提供 telemetryEnabled 开关,用户可随时关闭 上报仅包含匿名机器标识,不涉及对话内容、代码或 API 密钥 关闭方式 // settings.json { "telemetryEnabled": false } # 环境变量 DEEPCODE_TELEMETRY_ENABLED=0 deepcode 文件变更 文件 说明 src/common/telemetry.ts 新增 — 独立 telemetry 模块,导出 reportNewPrompt() src/settings.ts +12 行 — 类型定义 + 解析链 src/common/openai-client.ts +4 行 — 三处 return 透传 telemetryEnabled src/tools/executor.ts +1 行 — CreateOpenAIClient 类型补字段 src/session.ts -21/+3 行 — 删除内联代码,委托调用 docs/configuration.md +12 行 — 中文文档 docs/configuration_en.md +12 行 — 英文文档 验证 npm run check(typecheck + lint + format)✅ npm test(366 tests, 0 fail)✅ codex review --base origin/main ✅ — no discrete regression or correctness issue
Open Graph Description: 变更内容 创建 src/common/telemetry.ts,将 telemetry 上报逻辑从 session.ts 中拆分为独立模块 新增 telemetryEnabled 配置项,支持通过 settings.json 或环境变量控制匿名使用数据上报的开关(默认 true,opt-out) DeepcodingSettings / ResolvedDeepcodingSettings...
X Description: 变更内容 创建 src/common/telemetry.ts,将 telemetry 上报逻辑从 session.ts 中拆分为独立模块 新增 telemetryEnabled 配置项,支持通过 settings.json 或环境变量控制匿名使用数据上报的开关(默认 true,opt-out) DeepcodingSettings / ResolvedDeepcodingSettings...
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/130
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f4b34b1-8b8d-72b3-9f01-0290b798c088 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EBAA:397AD8:187651D:2141FE5:6A4F2863 |
| html-safe-nonce | 2d9ed22a08c43f40d0ffa46453a9c27a8d57a3c83724870311263c138d565a3c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkFBOjM5N0FEODoxODc2NTFEOjIxNDFGRTU6NkE0RjI4NjMiLCJ2aXNpdG9yX2lkIjoiMTU5OTE0NTg1ODAwMzA1MjY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b2ea945d6ebe9f32a52111f3f1fcfb0732c5a3d05ae32e6de9553e6f562d21a |
| hovercard-subject-tag | pull_request:3762887803 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/130/files |
| twitter:image | https://avatars.githubusercontent.com/u/2081487?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2081487?s=400&v=4 |
| og:image:alt | 变更内容 创建 src/common/telemetry.ts,将 telemetry 上报逻辑从 session.ts 中拆分为独立模块 新增 telemetryEnabled 配置项,支持通过 settings.json 或环境变量控制匿名使用数据上报的开关(默认 true,opt-out) DeepcodingSettings / ResolvedDeepcodingSettings... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width