Skip to content

Feat/mindtrace capture output#1282

Open
banearth wants to merge 3 commits intofarion1231:mainfrom
banearth:feat/mindtrace-capture-output
Open

Feat/mindtrace capture output#1282
banearth wants to merge 3 commits intofarion1231:mainfrom
banearth:feat/mindtrace-capture-output

Conversation

@banearth
Copy link
Copy Markdown

@banearth banearth commented Mar 4, 2026

中文 PR 描述

标题:feat(proxy): 增加 MindTrace 抓取输出目录与代理链路调试捕获

内容:

  1. 新增 MindTrace 文件存储模块(index.json + sessions/*.log),按 session 维度组织抓取结果,便于追踪一次完整代理会话。
  2. 在代理请求/响应链路增加调试捕获,记录 user -> agent、agent -> llm、llm -> agent 相关上下文。
  3. 新增设置项:
  • captureSystemPrompt(开启/关闭抓取)
  • debugCaptureOutputDir(自定义输出目录,Windows 默认 C:\Users\Public\CCSwitchMindTrace)
  1. 前端设置页新增输出目录输入、浏览、重置与保存交互。
  2. 保持主代理转发链路不变;捕获写入采用异步方式,避免阻塞主流程。
  3. 修复开关语义:关闭 captureSystemPrompt 时,请求和响应两侧均不再写入 MindTrace。

English PR Description

Title: feat(proxy): add MindTrace capture output directory and proxy debug capture pipeline

Description:

  1. Introduce a MindTrace file store (index.json + per-session sessions/*.log) to organize captured data by session for easier traceability.
  2. Add debug capture hooks in proxy request/response flows, including context around user -> agent, agent -> llm, and llm -> agent.
  3. Add new settings:
  • captureSystemPrompt (capture on/off)
  • debugCaptureOutputDir (custom output directory, default on Windows: C:\Users\Public\CCSwitchMindTrace)
  1. Add UI controls in Proxy settings for output directory input/browse/reset/save.
  2. Preserve existing proxy forwarding behavior; persistence is executed asynchronously to avoid blocking the main path.
  3. Fix gating semantics: when captureSystemPrompt is disabled, both request-side and response-side MindTrace writes are disabled.

@farion1231
Copy link
Copy Markdown
Owner

很抱歉让你等了这么久。这个项目目前只有我一个人在维护,之前有段时间确实没能及时跟进。这是我的错。你的贡献对项目很重要,我会安排 review。如果需要 rebase 到最新代码,告诉我或者我直接来处理都可以。感谢你的付出和耐心。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants