Skip to content

fix: symlink gh config in dev-env.js to preserve auth on Unix#358

Open
maxtara wants to merge 1 commit intostagingfrom
bug/npm-run-dev-macos
Open

fix: symlink gh config in dev-env.js to preserve auth on Unix#358
maxtara wants to merge 1 commit intostagingfrom
bug/npm-run-dev-macos

Conversation

@maxtara
Copy link
Collaborator

@maxtara maxtara commented Feb 13, 2026

Summary

Running npm run dev on Linux/macOS caused Copilot SDK authentication to fail because dev-env.js overrides XDG_CONFIG_HOME, which breaks gh CLI ability to find its auth token.

Root Cause

scripts/dev-env.js sets XDG_CONFIG_HOME=~/.cooper-dev, but gh CLI follows the XDG spec and looks for config at $XDG_CONFIG_HOME/gh/hosts.yml instead of the default ~/.config/gh/hosts.yml.

Fix

On Unix systems, automatically symlink ~/.config/gh to ~/.cooper-dev/gh before overriding XDG_CONFIG_HOME. This preserves dev isolation while allowing gh to find its auth token.

Windows is unaffected since it ignores XDG_CONFIG_HOME entirely.

Testing

  • All 395 unit tests pass
  • Requires manual verification on Linux/macOS:
    1. Remove any existing symlink: rm ~/.cooper-dev/gh
    2. Run npm run dev
    3. Confirm auth works and chat responds

@maxtara maxtara marked this pull request as ready for review February 13, 2026 08:13
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