Skip to content

fix: the update feed, the update check and the init switch are user settings only - #120

Open
ndemianc wants to merge 1 commit into
developfrom
fix/bundled-extension-settings-scope
Open

ndemianc wants to merge 1 commit into
developfrom
fix/bundled-extension-settings-scope

Conversation

@ndemianc

Copy link
Copy Markdown
Contributor

What

#113 made every levelcode-ai setting user-only. The other bundled extensions were left, and a folder's .vscode/settings.json can still set four of their settings, with its value winning over the user's, in a trusted folder and in Restricted Mode:

  • levelcode.update.url overrides the update feed. By reading the code, a folder that sets it makes the editor's update check offer a download from the folder's own address.
  • levelcode.update.enabled and levelcode.update.intervalHours switch that check off or change how often it asks.
  • levelcode.init.enabled decides whether the user's ~/.levelcode/init.js runs at start.

Restricted Mode does not help: levelcode-updater and levelcode-hackability both declare untrustedWorkspaces: { supported: true }, so VS Code applies no restriction.

v1.4.1 shipped with this open. Its notes say "LevelCode AI settings", which is accurate, and they do not mention it. This PR closes it.

Change

  • "scope": "application" on those four settings (extensions/levelcode-updater/package.json, extensions/levelcode-hackability/package.json).
  • A new suite, extensions/levelcode-updater/test/bundledSettingsScope.test.js, default-deny over every bundled extension except levelcode-ai, in the same shape as levelcode-ai's settingsScope.test.js. A setting added later is folder-settable only if someone puts it on the list, and the first test fails until they do. It also fails on a scope the editor does not know, since VS Code reads a misspelt one as window.

What a folder may still set

The levelcode-npp-pack's six editing preferences: bigFile.notify, bigFile.thresholdMB, jsonPaste.enabled, jsonPaste.indent, macros.maxReplayCount, macros.maxSteps. They change how the editor treats text and large files. None decides where anything is sent, what runs, or what is trusted. They are written out as the suite's list, so that decision is made in one place.

levelcode-themes contributes no settings.

Verified

  • Red first: the new suite fails on the v1.4.1 manifests, and the message names exactly the four settings.
  • Mutations, each caught: update.url loses its scope; a misspelt scope; a new unscoped setting added to the updater; init.enabled set to window.
  • The gate: ./scripts/test-extensions.sh passes, 138 files, exit 0, on macOS (Node 24).

Not verified

  • Not run in the real editor. I did not open a folder whose .vscode/settings.json sets levelcode.update.url and watch the update check. The mechanism is VS Code's application scope, which fix(agent): a folder's settings no longer change what the desktop agent may do #113 verified in the real editor for the levelcode-ai settings; I did not repeat that for these four.
  • Linux. The gate ran on macOS only, so this PR's test.yml run is the first Linux run. The suite reads JSON and uses no timers.
  • That a folder can in fact redirect the update link is from reading the setting's description and the extension's code, not from reproducing it.

Release notes

Not touched here. The next release's notes should say that the updater's and the init script's settings are now user-only, and that levelcode.update.url can no longer be set per project.

…ettings only

levelcode-ai's settings became application-scoped in #113, but the other
bundled extensions' settings were left, and a folder's .vscode/settings.json
can still set them, trusted or in Restricted Mode (untrustedWorkspaces is
true for these extensions, so VS Code applies no restriction):

- levelcode.update.url overrides the update feed, so a folder can make the
  editor's update check offer a download from the folder's own address.
- levelcode.update.enabled and .intervalHours switch that check off or
  change how often it asks.
- levelcode.init.enabled decides whether the user's ~/.levelcode/init.js
  runs at start.

All four are now "scope": "application". The npp-pack's six editing
preferences stay folder-settable, written out as an explicit list.

New suite levelcode-updater/test/bundledSettingsScope.test.js is
default-deny over every bundled extension except levelcode-ai, like
levelcode-ai's own settingsScope test: a setting added later is
folder-settable only if someone puts it on the list. It fails on the v1.4.1
manifests naming exactly these four settings. Mutations caught: update.url
unscoped, a misspelt scope, a new unscoped setting, init.enabled window-scoped.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 03:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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