Skip to content

Fix fs.constants import in global config permission check#6

Merged
shuv1337 merged 3 commits intofeature/config-endpoint-updatesfrom
copilot/sub-pr-5
Nov 7, 2025
Merged

Fix fs.constants import in global config permission check#6
shuv1337 merged 3 commits intofeature/config-endpoint-updatesfrom
copilot/sub-pr-5

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 6, 2025

The global config update permission check was accessing fs.constants from the fs/promises import, which doesn't expose constants in TypeScript types, causing a TypeError at runtime.

Changes:

  • Import constants from 'fs' module separately
  • Update permission check to use imported constants.W_OK instead of fs.constants.W_OK
// Before
import fs from "fs/promises"
await fs.access(Global.Path.config, fs.constants.W_OK)  // TypeError

// After
import fs from "fs/promises"
import { constants } from "fs"
await fs.access(Global.Path.config, constants.W_OK)  // Works correctly

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 7, 2025 00:04
Co-authored-by: kcrommett <523952+kcrommett@users.noreply.github.com>
Co-authored-by: kcrommett <523952+kcrommett@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Nov 7, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • models.dev
    • Triggering command: bun test test/config/config.test.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update config endpoint based on review feedback Fix fs.constants import in global config permission check Nov 7, 2025
Copilot AI requested a review from shuv1337 November 7, 2025 00:08
@shuv1337 shuv1337 marked this pull request as ready for review November 7, 2025 00:10
@shuv1337 shuv1337 merged commit 62822cf into feature/config-endpoint-updates Nov 7, 2025
@shuv1337 shuv1337 deleted the copilot/sub-pr-5 branch November 21, 2025 00:33
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