mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
perf(vscode): exclude patch from diff hash to reduce memory overhead (#8967)
* perf(vscode): exclude patch from diff hash to reduce memory overhead The hashFileDiffs function included diff.patch in its hash key, pulling in multi-MB payloads generated by opencode's context: MAX_SAFE_INTEGER setting. The extension never renders the patch string — VS Code's native diff editor uses before/after file contents instead — so the field was pure overhead. Closes #8951 * chore(kilo-docs): update source links
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Source Code Links
|
||||
|
||||
<!-- Auto-generated by script/extract-source-links.ts — DO NOT EDIT -->
|
||||
<!-- 79 unique URLs extracted from extension and CLI source -->
|
||||
<!-- 80 unique URLs extracted from extension and CLI source -->
|
||||
|
||||
- <https://api.apertis.ai/v1>
|
||||
<!-- packages/opencode/src/provider/model-cache.ts -->
|
||||
@@ -55,6 +55,8 @@
|
||||
<!-- packages/kilo-vscode/webview-ui/src/components/settings/AboutKiloCodeTab.tsx -->
|
||||
- <https://github.com/Kilo-Org/kilocode/issues/6986>
|
||||
<!-- packages/kilo-vscode/src/agent-manager/constants.ts -->
|
||||
- <https://github.com/Kilo-Org/kilocode/issues/8951>
|
||||
<!-- packages/kilo-vscode/src/review-utils.ts -->
|
||||
- <https://github.com/Kilo-Org/kilocode/issues/new?template=bug-report.yml>
|
||||
<!-- packages/opencode/src/cli/cmd/tui/app.tsx -->
|
||||
- <https://github.com/Kilo-Org/kilocode/issues/new/choose>
|
||||
|
||||
@@ -42,6 +42,19 @@ export async function resolveLocalDiffTarget(
|
||||
return { directory: root, baseBranch: base }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a lightweight hash key for a list of file diffs.
|
||||
*
|
||||
* Intentionally excludes `diff.patch` — the extension never renders the
|
||||
* unified-diff patch string (VS Code's native diff editor uses before/after
|
||||
* file contents instead). Including it would pull in multi-MB payloads
|
||||
* generated by opencode's `context: MAX_SAFE_INTEGER` setting, inflating
|
||||
* memory for no benefit. The remaining fields (file, status, additions,
|
||||
* deletions, tracked, generatedLike, summarized, stamp) are sufficient to
|
||||
* detect when the diff list has meaningfully changed.
|
||||
*
|
||||
* See: https://github.com/Kilo-Org/kilocode/issues/8951
|
||||
*/
|
||||
export function hashFileDiffs(
|
||||
diffs: Array<
|
||||
SnapshotFileDiff & {
|
||||
@@ -54,7 +67,6 @@ export function hashFileDiffs(
|
||||
): string {
|
||||
return diffs
|
||||
.map((diff) => {
|
||||
const content = diff.summarized ? "" : diff.patch
|
||||
return [
|
||||
diff.file,
|
||||
diff.status,
|
||||
@@ -64,7 +76,6 @@ export function hashFileDiffs(
|
||||
diff.generatedLike ? "generated" : "source",
|
||||
diff.summarized ? "summary" : "detail",
|
||||
diff.stamp ?? "",
|
||||
content,
|
||||
].join(":")
|
||||
})
|
||||
.join("|")
|
||||
|
||||
Reference in New Issue
Block a user