Skip to content

fix(types): use concrete Node stat result type - #10017

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-node-types-main
Jul 23, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-node-types-main

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • use Node Stats for stat(path) calls that do not pass options
  • preserve remote FileStat support in worktree Git-directory resolution
  • keep missing-path rejection and existing error handling unchanged across macOS, Linux, Windows, and SSH

Context

@types/node 25.9.5 adds undefined to the catch-all stat overload for callers that set throwIfNoEntry: false. ReturnType<typeof stat> selects that broad overload even though these callers invoke stat(path), whose precise overload resolves to Stats and rejects on a missing path.

This repairs the main-branch typecheck after #10006 and unblocks checks on main-based PRs such as #9997. It does not modify or stack on #9997.

Verification

  • pnpm install --frozen-lockfile
  • pnpm typecheck
  • pnpm exec vitest run src/main/ipc/worktree-base-directory-watcher.test.ts src/main/skills/skill-freshness-inventory.test.ts (31 tests)
  • pnpm exec oxlint src/main/ipc/worktree-common-git-directory.ts src/main/skills/skill-installation-topology.ts
  • pnpm exec oxfmt --check src/main/ipc/worktree-common-git-directory.ts src/main/skills/skill-installation-topology.ts
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 56c8bb5c-aedf-4e42-98aa-0ce4c03a50ee

📥 Commits

Reviewing files that changed from the base of the PR and between 01bcc57 and 67a3345.

📒 Files selected for processing (2)
  • src/main/ipc/worktree-common-git-directory.ts
  • src/main/skills/skill-installation-topology.ts

📝 Walkthrough

Walkthrough

Updated TypeScript typings to use Node.js Stats directly instead of deriving types from the promisified stat function. The change applies to Git directory stat results and the skillPhysicalIdentity function parameter, with runtime behavior and control flow unchanged.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, context, and verification, but it omits several required template sections. Add the missing Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections to match the required template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: using the concrete Node stat result type for typing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant