feat: handle Docker/no-HOME env gracefully — plugin cache /tmp fallback, telemetry skip#375
Merged
theoephraim merged 2 commits intosupport-xdg-config-homefrom Mar 12, 2026
Merged
Conversation
|
…try graceful skip Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [#348] Add support for $XDG_CONFIG_HOME for user config directory
feat: handle Docker/no-HOME env gracefully — plugin cache /tmp fallback, telemetry skip
Mar 12, 2026
philmillman
approved these changes
Mar 12, 2026
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.
When running in Docker without
HOMEset,os.homedir()returns/dev/null. The plugin cache had no fallback (breaking plugin loading), and telemetry wouldgracefulExit(1)instead of skipping cleanly.Changes
user-config-dir.tsgetUserVarlockDir()returnsstring | null—nullwhenos.homedir() === '/dev/null'getPluginCacheDir(): returns<userVarlockDir>/plugins-cachenormally, falls back to<tmpdir>/varlock-plugins-cacheso plugin downloads always have a writable locationplugins.tsgetPluginCacheDir()— picks up the/tmpfallback automaticallytelemetry.tscheckIsOptedOut()returnstrueearly when no home dir — telemetry silently skippedloadVarlockConfig,getAnonymousId) null-guardedgracefulExit(1)for the Docker no-HOME casetelemetry.command.tsCliExitErrorwhenHOMEis unset, with instructions to setHOMEorXDG_CONFIG_HOMETests
user-config-dir.test.tscovers all threegetUserVarlockDir()resolution cases (XDG, legacy~/.varlock, default~/.config/varlock) plus the Docker null case andgetPluginCacheDir()/tmpfallback💡 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.