MoonshotAI / MoonshotAI/kimi-code
feat: 为 export-debug-zip 增加导出前脱敏与预览控制
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What feature would you like to see?
希望 /export-debug-zip / kimi export 在生成诊断包前,提供更明确的隐私控制和预览能力。
可以考虑的能力:
- 导出前展示将被打包的内容类别,例如 session wire、session log、global log、manifest 等。
- 在 TUI 中让用户确认是否包含 global log / session log / wire 记录;CLI 中提供对应参数。
- 默认对常见敏感信息做 best-effort redaction,例如
Authorization、api_key、token、secret、password、sk-*等。 - 在 manifest 中记录 redaction 是否启用、是否包含 global log、导出内容摘要,便于维护者理解诊断包来源。
- 保留类似
--no-include-global-log的显式 opt-out,同时可以增加--no-redact这类高级开关,仅在用户明确需要原始日志时使用。
这个请求不是报告一个具体的泄露漏洞,而是希望提升用户分享诊断包前的可控性和信心。
Additional information
当前实现里,session export 会递归收集 session 目录文件并写入 zip;当 includeGlobalLog=true 时,也会把 global log 加入诊断包。现在已有 --no-include-global-log,但缺少导出前预览和面向诊断包内容的统一 redaction/manifest 标记。
这个能力对开源社区尤其有用:用户经常需要把诊断包发给维护者,但 session 记录、日志和上下文里可能包含项目路径、prompt 片段、环境信息或第三方服务错误内容。导出前的预览和默认脱敏可以减少“能不能公开发这个 zip”的心理负担。
我搜索过 debug zip redaction、redact export、secret export、export-debug-zip、privacy export。已有 PR 主要是新增/文档化 /export-debug-zip 或在错误提示中引导使用它,没有找到导出前预览/脱敏控制相关的 issue 或未合并 PR。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the /export-debug-zip and kimi export entry points, then inspect the session export path that recursively collects session files and optionally adds the global log. Review how the manifest is written and how --no-include-global-log is handled. Done should be defined around preview and inclusion controls, consistent redaction behavior, and manifest metadata, with coverage for the supported export paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100