이력의 한영 오타 원문도 변환해서 모델에 넘김 — 세션엔 'ahsxoskwnrk djel dlTwl?' 원문이 저장돼(현재 턴만 변환), 다음 턴 모델은 앞 질문(몬태나주가 어디 있지?)을 깨진 글자로만 봐서 "지도 열어줘"에 어느 곳이냐고 되물음
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6622ceb78
commit
4f3a2f02a5
1 file changed
+9
-2
@@ -260,9 +260,16 @@ async function handleChat(
|
||||
setWorkspace(sessionId, workspacePath, username);
|
||||
}
|
||||
const historyTurns = (getConfig().getConfig() as any)?.session?.historyTurns ?? 8;
|
||||
const history = historyOverride
|
||||
const history = (historyOverride
|
||||
? historyOverride.map(m => ({ role: m.role as 'user' | 'assistant', content: String(m.content) }))
|
||||
: getHistoryForApiCall(sessionId, historyTurns, username);
|
||||
: getHistoryForApiCall(sessionId, historyTurns, username)
|
||||
).map(h => {
|
||||
// 세션에는 한영 오타 원문이 저장된다(server.ts가 handleChat 전에 저장). 그대로 이력에 실으면 다음 턴 모델은
|
||||
// "ahsxoskwnrk djel dlTwl?"만 보고 앞 질문을 모른다(10-25 몬태나 → "지도 열어줘"에 어디냐고 되물음).
|
||||
if (executionMode !== 'interactive' || h.role !== 'user' || typeof h.content !== 'string') return h;
|
||||
const fixed = fixKeyboardLayout(h.content);
|
||||
return fixed ? { ...h, content: fixed.text } : h;
|
||||
});
|
||||
// 인자 보정 게이트가 볼 텍스트. 현재 메시지만 보면 "더 보여줘" 같은 후속 요청에서 앞 턴의
|
||||
// 주제가 사라진다 — 모델은 대화 이력을 받아 맥락을 아는데 보정 쪽만 몰라서, 맥락을 아는 쪽의
|
||||
// 판단을 모르는 쪽이 덮어쓰게 된다(2026-08-12 사용자 지적). 직전 사용자 발화 2턴까지만 본다:
|
||||
|
||||
Reference in new issue
Block a user