fix(hashline-read-enhancer): skip hashifying OpenCode-truncated lines

This commit is contained in:
YeonGyu-Kim
2026-02-24 18:21:05 +09:00
parent ac962d62ab
commit 1785313f3b
2 changed files with 31 additions and 0 deletions
+4
View File
@@ -13,6 +13,7 @@ const CONTENT_OPEN_TAG = "<content>"
const CONTENT_CLOSE_TAG = "</content>"
const FILE_OPEN_TAG = "<file>"
const FILE_CLOSE_TAG = "</file>"
const OPENCODE_LINE_TRUNCATION_SUFFIX = "... (line truncated to 2000 chars)"
function isReadTool(toolName: string): boolean {
return toolName.toLowerCase() === "read"
@@ -56,6 +57,9 @@ function transformLine(line: string): string {
if (!parsed) {
return line
}
if (parsed.content.endsWith(OPENCODE_LINE_TRUNCATION_SUFFIX)) {
return line
}
const hash = computeLineHash(parsed.lineNumber, parsed.content)
return `${parsed.lineNumber}#${hash}|${parsed.content}`
}