Replace ChatLogsData with comprehensive SessionDebugBundle schema (#2488)
## Summary
- Replaces the old `ChatLogsDataSchema` with a new
`SessionDebugBundleSchema` (schema version 1) that captures all
non-sensitive data needed for debugging chat sessions
- Each message now includes AI SDK JSON (with base64 images stripped),
model name, token usage, timestamps, commit hashes, request ID, and
approval state
- Adds non-sensitive user settings snapshot, app metadata, custom
provider/model definitions, and MCP server configurations to the debug
bundle
- Updates HelpDialog to use the new schema and adds `Session Schema:
v2.0` marker to GitHub issue templates
## Test plan
- [ ] Verify `npm run ts` passes (type-check)
- [ ] Verify `npm run lint` passes
- [ ] Verify `npm test` passes (all 661 unit tests)
- [ ] Manual: Open Help dialog → Upload Chat Session → verify the review
modal shows messages, codebase, logs, and system info correctly
- [ ] Manual: Complete upload and verify the GitHub issue template
includes `Session Schema: v2.0`
- [ ] Manual: Download uploaded JSON and verify it contains:
`schemaVersion`, `system`, `settings`, `app`, `chat` (with
`aiMessagesJson` per message), `providers`, `mcpServers`, `codebase`,
`logs`
- [ ] Manual: Verify no API keys, OAuth tokens, or MCP env vars appear
in uploaded data
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2488">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Expands what gets captured and uploaded for support sessions
(settings/app metadata/providers/MCP and richer message data), so any
sanitization or schema mismatch could leak data or break the support
upload flow.
>
> **Overview**
> Switches chat-session uploads from `ChatLogsData` to a new versioned
`SessionDebugBundle` (`SESSION_DEBUG_SCHEMA_VERSION = 2`) and updates
the IPC contract/exports accordingly.
>
> The main-process handler now assembles a comprehensive bundle
(system/runtime info, sanitized settings snapshot, app metadata, full
chat messages with stripped image/file blobs, custom provider/model
summaries, MCP server configs without env/header secrets, codebase
snapshot, and last ~1000 log lines), and `HelpDialog` is updated to
fetch/review/upload this bundle and annotate created GitHub issues with
`Session Schema: v2.0` (plus adds a settings section to the bug report
template).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7b94199939aa6963787e8fe69716e20cd6570b7d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
请
注册
或者
登录
后发表评论