Skip to content

Restore readFile import so source windows open again - #519

Merged
milanb17 merged 1 commit into
mainfrom
claude/fix-navigator-readfile
Sep 23, 2026
Merged

milanb17 merged 1 commit into
mainfrom
claude/fix-navigator-readfile

Conversation

@milanb17

Copy link
Copy Markdown
Contributor

Summary

main currently fails typecheck, and in Desktop, Source tree and full-file opens do nothing. Every request to open a source window fails on the server:

POST /reviews-api/<id>/navigator failed: ReferenceError: readFile is not defined
    at readWorkspace (…/review-api/local-data.ts:1732)

Cause

Two PRs that each passed CI on their own conflicted in meaning once both merged:

Fix

Re-add readFile to the node:fs/promises import. Plain node:fs is correct here: the .code-workspace file lives under .git/dev-fast/…, not inside a checkout, so the .asar handling doesn't apply. The same function already writes that file with plain fs.

Validation

  • tsc --noEmit -p packages/review reports the missing readFile without the fix and passes with it. This is the TS2304 currently failing main'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 the navigatorWorkspace tests that read existing workspace files.

🤖 Generated with Claude Code

#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
@milanb17
milanb17 enabled auto-merge (squash) September 23, 2026 22:53
@milanb17
milanb17 merged commit 4f756d0 into main Sep 23, 2026
1 check passed
@milanb17
milanb17 deleted the claude/fix-navigator-readfile branch September 23, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants