Restore readFile import so source windows open again - #519
Merged
Merged
Conversation
#513 moved checkout reads to checkoutFs and dropped readFile from the node:fs/promises import. #515, written before that, added readWorkspace, which still calls readFile. Each passed CI alone; together every source window request fails with 'ReferenceError: readFile is not defined', so Source tree and Open file do nothing. The workspace file lives under .git/dev-fast, not in a checkout, so plain node:fs is correct here, matching the write in the same function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: 8b958fd7-34fd-47a8-b6dd-c7d8c2f89db4
thesiti92
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maincurrently fails typecheck, and in Desktop, Source tree and full-file opens do nothing. Every request to open a source window fails on the server:Cause
Two PRs that each passed CI on their own conflicted in meaning once both merged:
checkoutFs(Electron's.asarfix) and droppedreadFilefrom thenode:fs/promisesimport, because it had no other callers at that point.readWorkspace(), which calls plainreadFile.Fix
Re-add
readFileto thenode:fs/promisesimport. Plainnode:fsis correct here: the.code-workspacefile lives under.git/dev-fast/…, not inside a checkout, so the.asarhandling doesn't apply. The same function already writes that file with plain fs.Validation
tsc --noEmit -p packages/reviewreports the missingreadFilewithout the fix and passes with it. This is theTS2304currently failingmain's CI and open PRs such as Simplify README and trim docs for the Whiteboard name #516.vitest run src/review-api/local-data.test.ts: all 82 pass, including thenavigatorWorkspacetests that read existing workspace files.🤖 Generated with Claude Code