fix(vscode): lower tsserver heap ceiling, pin more UI-only extensions - #789
Open
ppat wants to merge 1 commit into
Open
fix(vscode): lower tsserver heap ceiling, pin more UI-only extensions#789ppat wants to merge 1 commit into
ppat wants to merge 1 commit into
Conversation
typescript.tsserver.maxTsServerMemory (dotfiles#773) is a deprecated key -- still honored as a fallback in the installed extension (verified against its compiled dist/extension.js) but replaced here with the current js/ts.tsserver.maxMemory, same window scope. Its value was also wrong for the goal: TypeScript spawns two tsserver processes that each read this same setting independently, so the previous 2048 let tsserver alone claim up to 4096 MiB against the operator's 2048 MiB budget for the whole remote VS Code tree. 768 sits well above both processes' measured resting PSS on a live workspace (~142/~112 MiB) while actually bounding the pair. Adds hashicorp.hcl and samuelcolvin.jinjahtml to remote.extensionKind alongside the existing vscode-icons/markdown-mermaid entries -- both are grammar-only (no LSP client, no fs/child_process use in their source), confirmed against the extensions actually installed under ~/.vscode-server/extensions on a live workspace. davidanson.vscode-markdownlint was considered and left on the remote: its markdownlint.lintWorkspace command does real work against the workspace filesystem. Most of the tree still has no heap-ceiling knob at all (extension host, file watcher, pty host, the JSON/Markdown/TOML language servers), so this does not by itself guarantee the tree fits 2048 MiB -- see the comment above js/ts.tsserver.maxMemory and dotfiles#772. Ref: #772 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Follow-up to #773 / #772, in response to a coordinated change in
ppat/coderthat apportions the workspace memory watchdog's per-role budgets against a
2048 MiB envelope for the whole remote VS Code tree. The watchdog kills on a
ten-minute dwell; this is the "shrink it at the source instead" half of that
work, entirely in dotfiles.
typescript.tsserver.maxTsServerMemory->js/ts.tsserver.maxMemory,2048 -> 768. The old key is deprecated (still honored as a fallback,
verified in the installed extension's compiled JS) and the old value was
wrong for the actual topology: TypeScript spawns two tsserver processes
that each read this same setting independently, so 2048 let tsserver alone
claim up to 4096 MiB against a 2048 MiB budget. 768 sits well above both
processes' measured resting PSS on a live workspace (~142 / ~112 MiB).
remote.extensionKind: addedhashicorp.hclandsamuelcolvin.jinjahtmlalongside the existing
vscode-icons-team.vscode-icons/bierner.markdown-mermaidentries. Both are grammar/syntax-highlightingonly -- no LSP client, no
fs/child_processuse -- confirmed against theextensions actually installed under
~/.vscode-server/extensionson a liveworkspace.
davidanson.vscode-markdownlintwas considered and left on theremote (default): it contributes a
markdownlint.lintWorkspacecommandthat does real work against the workspace filesystem.
Both changes land in the Mac client User settings file only. Verified
js/ts.tsserver.maxMemoryand the deprecated key are bothscope: "window"in the installed extension's own configuration.json, and
remote.extensionKindis APPLICATION-scoped per VS Code's remote docs (as #773 already established) --
neither belongs in the remote Machine settings file, which parses only
[MACHINE, MACHINE_OVERRIDABLE]and would silently drop them. No changes tothe Machine settings file in this PR.
Coverage gap (cannot verify from here)
Written from inside the live Coder workspace this targets, where
chezmoi applyis off-limits (shared pod, live sessions) andprivate_Library/**isignored entirely on this host (
.chezmoiignore,homeDir == /home/coder) --so
chezmoi diffcannot exercise this file from here either. Verifiedinstead with
chezmoi execute-template(fakebitwardenSecretssubstitution,same technique
full-apply-test.yamluses) confirming the template rendersto valid JSONC, plus direct inspection of the running server's processes and
the installed extensions' source/
package.jsonon that same live workspace.What the operator should check after
chezmoi applyon the Mac and awindow reload/reconnect: open Settings UI in the reconnected remote window,
search
tsserver.maxMemory, confirm it shows768with User (not adefault/Remote-Machine) provenance badge; same for the two new
remote.extensionKindentries, then confirm via Help: Show RunningExtensions that
hashicorp.hclandsamuelcolvin.jinjahtmlshow asrunning on the UI extension host rather than the remote one. Also worth
noting: the previous
typescript.tsserver.maxTsServerMemory: 2048from#773 does not appear to have taken effect yet on this same live workspace --
its running tsserver processes still show the extension's own unconfigured
default (
--max-old-space-size=3072), on a server session that startedafter #773 merged. Most likely explanation is simply that
chezmoi applyhasn't run on the Mac since #773, but I can't rule out a scope-routing issue
from here -- the check above will settle it either way for this PR's value
too.
What's still uncapped, and why nothing was added for it
Only
js/ts.tsserver.maxMemoryandremote.extensionKindare usable leversfrom dotfiles. Checked each other node-backed process in the tree
(
/proc/<pid>/cmdlineon a live workspace) for an equivalent heap-ceilingsetting and found none: the extension host itself (685-738 MiB PSS observed,
the tree's biggest and most volatile process, and the reason
remote.extensionKindmatters more than the heap ceiling here), the filewatcher, pty host, and the JSON/Markdown/TOML language server processes all
have no exposed memory-limit configuration.
NODE_OPTIONSwould reach all ofthem (none pass an explicit
--max-old-space-sizeof their own, so aninherited env var would apply) but only if set in whatever environment
launches the remote server process tree -- which on a Coder workspace is
provisioned by the template, not dotfiles, and setting it globally via a
dotfiles shell-profile export would leak the same low ceiling onto every
unrelated Node process the operator or Claude Code runs in a terminal. Not
implemented for that reason. This means the PR does not by itself guarantee
the whole tree fits 2048 MiB -- see the comment above
js/ts.tsserver.maxMemory.Test plan
pre-commit run --all-filesclean (baseline was already clean atorigin/main, no unrelated findings touched)chezmoi execute-templateon the changed file (fakebitwardenSecretssubstitution) renders valid JSONC
chezmoi applyon the Mac, reload/reconnect the remotewindow, verify per the Settings UI / Running Extensions checks above
Ref: #772
🤖 Generated with Claude Code
https://claude.ai/code/session_0197hA8JPwGMX8wufiQiy6oz