mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
fix: ACP prompt 未切换全局 sessionId 导致 transcript 写入错误会话文件
prompt() 在调用 submitMessage 前没有 switchSession,recordTranscript 依赖全局 getSessionId() 确定写入路径,多会话场景下新会话内容会覆盖旧会话。
This commit is contained in:
@@ -300,6 +300,10 @@ export class AcpAgent implements Agent {
|
||||
// After a previous interrupt(), the internal controller is stuck in
|
||||
// aborted state — without this, submitMessage() fails immediately.
|
||||
session.queryEngine.resetAbortController()
|
||||
// Switch global session state so recordTranscript writes to the correct
|
||||
// session file. Without this, multi-session scenarios (or creating a new
|
||||
// session after another) write transcript data to the wrong file.
|
||||
switchSession(params.sessionId as SessionId, getSessionProjectDir())
|
||||
|
||||
const sdkMessages = session.queryEngine.submitMessage(promptInput)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user