openclaw - 💡(How to fix) Fix Debug: 提供逐轮 AI 请求/响应完整 JSON 查看能力

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

当前排查 AI 请求链路时,缺少一套方便、完整、逐轮可查看的调试能力。使用者需要看到每一轮 AI 请求发出去的完整 JSON,以及服务端/模型返回的完整 JSON,才能分析问题根因。

Root Cause

当前排查 AI 请求链路时,缺少一套方便、完整、逐轮可查看的调试能力。使用者需要看到每一轮 AI 请求发出去的完整 JSON,以及服务端/模型返回的完整 JSON,才能分析问题根因。

RAW_BUFFERClick to expand / collapse

Context

当前排查 AI 请求链路时,缺少一套方便、完整、逐轮可查看的调试能力。使用者需要看到每一轮 AI 请求发出去的完整 JSON,以及服务端/模型返回的完整 JSON,才能分析问题根因。

Proposal

提供一个便捷的 debug 机制,用于查看 AI 调用链路中每一轮的完整请求与响应 JSON。

建议覆盖:

  • 发往模型/路由器/AI provider 的完整 request JSON
  • 收到的完整 response JSON
  • 每一轮对话/工具调用对应的一组 request/response
  • 能按 session、message、run 或 request id 定位
  • 默认不影响正常使用,开启 debug 后可查看或导出

Acceptance Criteria

  • 可以非常方便地开启 AI 请求/响应 JSON debug,不需要改代码重新编译
  • 每一轮 AI 调用都能看到完整 request JSON
  • 每一轮 AI 调用都能看到完整 response JSON
  • request/response 能按同一个 correlation id 或 run/session/message id 对齐
  • 支持查看多轮完整链路,而不是只看最后一次调用
  • 敏感字段处理有明确策略:默认脱敏,必要时有受控方式查看完整原文
  • debug 输出位置明确,例如 CLI 命令、日志文件、Gateway API 或 UI 面板之一

Implementation Notes

  • 需要避免把完整 payload 永久写入普通日志造成泄密风险。
  • 建议设计显式开关,例如环境变量、配置项、CLI flag 或按 session 临时开启。
  • 如存在 streaming 响应,需要能重建完整 response JSON 或保存原始事件流。

Source

来自 Lukin 在 Feishu 群里的需求:需要能看到“整个 AI 请求发出去的 JSON 和收到的 JSON,完整的,每一轮都能看到”,否则无法 debug。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Debug: 提供逐轮 AI 请求/响应完整 JSON 查看能力