Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
c2696cf1
Unverified
提交
c2696cf1
authored
6月 09, 2025
作者:
Will Chen
提交者:
GitHub
6月 09, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better error logs when reporting bug/uploading chat session (#370)
Co-authored-by:
graphite-app[bot]
<
96075541+graphite-app[bot]@users.noreply.github.com
>
上级
8d9962dd
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
51 行增加
和
10 行删除
+51
-10
HelpDialog.tsx
src/components/HelpDialog.tsx
+5
-4
debug_handlers.ts
src/ipc/handlers/debug_handlers.ts
+45
-6
ipc_types.ts
src/ipc/ipc_types.ts
+1
-0
没有找到文件。
src/components/HelpDialog.tsx
浏览文件 @
c2696cf1
...
@@ -83,10 +83,11 @@ export function HelpDialog({ isOpen, onClose }: HelpDialogProps) {
...
@@ -83,10 +83,11 @@ export function HelpDialog({ isOpen, onClose }: HelpDialogProps) {
- Dyad Version:
${
debugInfo
.
dyadVersion
}
- Dyad Version:
${
debugInfo
.
dyadVersion
}
- Platform:
${
debugInfo
.
platform
}
- Platform:
${
debugInfo
.
platform
}
- Architecture:
${
debugInfo
.
architecture
}
- Architecture:
${
debugInfo
.
architecture
}
- Node Version:
${
debugInfo
.
nodeVersion
||
"Not available"
}
- Node Version:
${
debugInfo
.
nodeVersion
||
"n/a"
}
- PNPM Version:
${
debugInfo
.
pnpmVersion
||
"Not available"
}
- PNPM Version:
${
debugInfo
.
pnpmVersion
||
"n/a"
}
- Node Path:
${
debugInfo
.
nodePath
||
"Not available"
}
- Node Path:
${
debugInfo
.
nodePath
||
"n/a"
}
- Telemetry ID:
${
debugInfo
.
telemetryId
||
"Not available"
}
- Telemetry ID:
${
debugInfo
.
telemetryId
||
"n/a"
}
- Model:
${
debugInfo
.
selectedLanguageModel
||
"n/a"
}
## Logs
## Logs
\`\`\`
\`\`\`
...
...
src/ipc/handlers/debug_handlers.ts
浏览文件 @
c2696cf1
...
@@ -12,9 +12,16 @@ import { db } from "../../db";
...
@@ -12,9 +12,16 @@ import { db } from "../../db";
import
{
chats
,
apps
}
from
"../../db/schema"
;
import
{
chats
,
apps
}
from
"../../db/schema"
;
import
{
eq
}
from
"drizzle-orm"
;
import
{
eq
}
from
"drizzle-orm"
;
import
{
getDyadAppPath
}
from
"../../paths/paths"
;
import
{
getDyadAppPath
}
from
"../../paths/paths"
;
import
{
LargeLanguageModel
}
from
"@/lib/schemas"
;
// Shared function to get system debug info
// Shared function to get system debug info
async
function
getSystemDebugInfo
():
Promise
<
SystemDebugInfo
>
{
async
function
getSystemDebugInfo
({
linesOfLogs
,
level
,
}:
{
linesOfLogs
:
number
;
level
:
"warn"
|
"info"
;
}):
Promise
<
SystemDebugInfo
>
{
console
.
log
(
"Getting system debug info"
);
console
.
log
(
"Getting system debug info"
);
// Get Node.js and pnpm versions
// Get Node.js and pnpm versions
...
@@ -63,8 +70,27 @@ async function getSystemDebugInfo(): Promise<SystemDebugInfo> {
...
@@ -63,8 +70,27 @@ async function getSystemDebugInfo(): Promise<SystemDebugInfo> {
const
logPath
=
log
.
transports
.
file
.
getFile
().
path
;
const
logPath
=
log
.
transports
.
file
.
getFile
().
path
;
if
(
fs
.
existsSync
(
logPath
))
{
if
(
fs
.
existsSync
(
logPath
))
{
const
logContent
=
fs
.
readFileSync
(
logPath
,
"utf8"
);
const
logContent
=
fs
.
readFileSync
(
logPath
,
"utf8"
);
const
logLines
=
logContent
.
split
(
"
\
n"
);
logs
=
logLines
.
slice
(
-
100
).
join
(
"
\
n"
);
const
logLines
=
logContent
.
split
(
"
\
n"
).
filter
((
line
)
=>
{
if
(
level
===
"info"
)
{
return
true
;
}
// Example line:
// [2025-06-09 13:55:05.209] [debug] (runShellCommand) Command "which node" succeeded with code 0: /usr/local/bin/node
const
logLevelRegex
=
/
\[
.*
?\]
\[(\w
+
)\]
/
;
const
match
=
line
.
match
(
logLevelRegex
);
if
(
!
match
)
{
// Include non-matching lines (like stack traces) when filtering for warnings
return
true
;
}
const
logLevel
=
match
[
1
];
if
(
level
===
"warn"
)
{
return
logLevel
===
"warn"
||
logLevel
===
"error"
;
}
return
true
;
});
logs
=
logLines
.
slice
(
-
linesOfLogs
).
join
(
"
\
n"
);
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
"Failed to read log file:"
,
err
);
console
.
error
(
"Failed to read log file:"
,
err
);
...
@@ -76,6 +102,8 @@ async function getSystemDebugInfo(): Promise<SystemDebugInfo> {
...
@@ -76,6 +102,8 @@ async function getSystemDebugInfo(): Promise<SystemDebugInfo> {
pnpmVersion
,
pnpmVersion
,
nodePath
,
nodePath
,
telemetryId
,
telemetryId
,
selectedLanguageModel
:
serializeModelForDebug
(
settings
.
selectedModel
)
||
"unknown"
,
telemetryConsent
:
settings
.
telemetryConsent
||
"unknown"
,
telemetryConsent
:
settings
.
telemetryConsent
||
"unknown"
,
telemetryUrl
:
"https://us.i.posthog.com"
,
// Hardcoded from renderer.tsx
telemetryUrl
:
"https://us.i.posthog.com"
,
// Hardcoded from renderer.tsx
dyadVersion
,
dyadVersion
,
...
@@ -90,7 +118,10 @@ export function registerDebugHandlers() {
...
@@ -90,7 +118,10 @@ export function registerDebugHandlers() {
"get-system-debug-info"
,
"get-system-debug-info"
,
async
():
Promise
<
SystemDebugInfo
>
=>
{
async
():
Promise
<
SystemDebugInfo
>
=>
{
console
.
log
(
"IPC: get-system-debug-info called"
);
console
.
log
(
"IPC: get-system-debug-info called"
);
return
getSystemDebugInfo
();
return
getSystemDebugInfo
({
linesOfLogs
:
20
,
level
:
"warn"
,
});
},
},
);
);
...
@@ -100,8 +131,12 @@ export function registerDebugHandlers() {
...
@@ -100,8 +131,12 @@ export function registerDebugHandlers() {
console
.
log
(
`IPC: get-chat-logs called for chat
${
chatId
}
`
);
console
.
log
(
`IPC: get-chat-logs called for chat
${
chatId
}
`
);
try
{
try
{
// Get system debug info using the shared function
// We can retrieve a lot more lines here because we're not limited by the
const
debugInfo
=
await
getSystemDebugInfo
();
// GitHub issue URL length limit.
const
debugInfo
=
await
getSystemDebugInfo
({
linesOfLogs
:
1
_000
,
level
:
"info"
,
});
// Get chat data from database
// Get chat data from database
const
chatRecord
=
await
db
.
query
.
chats
.
findFirst
({
const
chatRecord
=
await
db
.
query
.
chats
.
findFirst
({
...
@@ -156,3 +191,7 @@ export function registerDebugHandlers() {
...
@@ -156,3 +191,7 @@ export function registerDebugHandlers() {
console
.
log
(
"Registered debug IPC handlers"
);
console
.
log
(
"Registered debug IPC handlers"
);
}
}
function
serializeModelForDebug
(
model
:
LargeLanguageModel
):
string
{
return
`
${
model
.
provider
}
:
${
model
.
name
}
| customId:
${
model
.
customModelId
}
`
;
}
src/ipc/ipc_types.ts
浏览文件 @
c2696cf1
...
@@ -104,6 +104,7 @@ export interface SystemDebugInfo {
...
@@ -104,6 +104,7 @@ export interface SystemDebugInfo {
platform
:
string
;
platform
:
string
;
architecture
:
string
;
architecture
:
string
;
logs
:
string
;
logs
:
string
;
selectedLanguageModel
:
string
;
}
}
export
interface
LocalModel
{
export
interface
LocalModel
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论