fix(edit): skipped notebook bom sniffing

Skipped binary BOM detection for notebook-backed hashline reads so virtual cell text is serialized without a leading U+FEFF marker.
This commit is contained in:
roboomp
2026-06-30 05:58:01 +00:00
parent dd4eb68b37
commit 7ec00a5007
3 changed files with 38 additions and 3 deletions
@@ -28,6 +28,7 @@ import { invalidateFsScanAfterWrite } from "../../tools/fs-cache-invalidation";
import { isInternalUrlPath } from "../../tools/path-utils";
import { enforcePlanModeWrite, resolvePlanPath, targetsLocalSandbox } from "../../tools/plan-mode-guard";
import { canonicalSnapshotKey } from "../file-snapshot-store";
import { isNotebookPath } from "../notebook";
import { readEditFileText, serializeEditFileText } from "../read-file";
import type { LspBatchRequest } from "../renderer";
@@ -123,8 +124,9 @@ export class HashlineFilesystem extends Filesystem {
return content;
}
async readBinary(relativePath: string): Promise<Uint8Array> {
async readBinary(relativePath: string): Promise<Uint8Array | undefined> {
const absolutePath = this.resolveAbsolute(relativePath);
if (isNotebookPath(absolutePath)) return undefined;
try {
return await fs.readFile(absolutePath);
} catch (error) {