Skip to content

Commit 27a689d

Browse files
ErlichLiuclaude
andcommitted
fix: 修复 @file: 中文路径编码失败和 AskUserQuestion 被误杀
P0-1: htmlToMarkdown 移除 encodeURIComponent,@file: 直接传原始路径, 修复中文文件名传给 Agent 后无法识别的问题。 P0-2: finally 块不再清理 askUserService 待处理请求,避免 turn 结束时 误杀正在等待用户回答的 AskUserQuestion。真正清理保留在 DELETE_SESSION。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0caa6e7 commit 27a689d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

apps/electron/src/main/lib/agent-orchestrator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,8 @@ export class AgentOrchestrator {
19611961
this.queuedMessageUuids.delete(sessionId)
19621962
}
19631963
permissionService.clearSessionPending(sessionId)
1964-
askUserService.clearSessionPending(sessionId)
1964+
// askUserService 不在 turn 结束时清理——AskUserQuestion 的生命周期由用户交互决定,
1965+
// 仅在会话真正删除时(DELETE_SESSION IPC)才清理。
19651966
exitPlanService.clearSessionPending(sessionId)
19661967
}
19671968
}

apps/electron/src/renderer/components/ai-elements/rich-text-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function htmlToMarkdown(html: string): string {
122122
if (dataType === 'mention') {
123123
if (suggestionChar === '/') return `/skill:${dataId}`
124124
if (suggestionChar === '#') return `#mcp:${dataId}`
125-
return `@file:${encodeURIComponent(dataId)}`
125+
return `@file:${dataId}`
126126
}
127127
return children
128128
}

0 commit comments

Comments
 (0)