Skip to content

[Bug]: Desktop drops AZURE_CONFIG_DIR (and other CLI config env vars) from the shell profile, so Azure DevOps issues fail with 'not authenticated' #44435

Done

Description

@vakesz

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. On macOS, keep Azure CLI state in a non-default location by exporting it from the shell profile, e.g. in $ZDOTDIR/.zshenv:
    export AZURE_CONFIG_DIR="$XDG_DATA_HOME/azure"
    export AZURE_DEVOPS_CACHE_DIR="$XDG_CACHE_HOME/azure-devops"
  2. In a terminal, az login and az devops configure --defaults organization=.... az devops project list and az boards query ... work.
  3. Launch T3 Code from the Dock/Finder and open the Issues view for an Azure DevOps repo.

Expected behavior

Azure DevOps issues are listed, using the same CLI config the user's shell uses.

Actual behavior

The Issues view is empty. The server trace shows:

AzureDevOpsIssueTracker.listIssues → IssueTrackerError: azure-devops failed in listIssues:
Azure DevOps CLI is not authenticated. Run `az devops login` and retry.
  VcsProcessExitError: VCS process failed in AzureDevOpsCli.execute: az (<repo>) exited with 1 - Authentication failed.

The cause: apps/desktop/src/shell/DesktopShellEnvironment.ts copies only an allowlist of variables from the login-shell probe (PATH, HOMEBREW_*, JAVA_HOME, PNPM_HOME, SSL_CERT_*, …). shell-environment-cache.json confirms that AZURE_CONFIG_DIR is dropped. Without it, az falls back to ~/.azure, which has no login and no default org. As a side effect, T3 creates a second, empty ~/.azure with its own copy of the azure-devops extension.

Workaround: ln -s "$AZURE_CONFIG_DIR" ~/.azure.

This is the same class of bug as #22816 / #36314 (CLAUDE_CODE_OAUTH_TOKEN) and is related to #24124. Any CLI that T3 shells out to and that reads its config location from the environment hits it: AZURE_CONFIG_DIR, AZURE_DEVOPS_EXT_PAT, GH_CONFIG_DIR, GLAB_CONFIG_DIR, KUBECONFIG, AWS_PROFILE/AWS_CONFIG_FILE, and so on. Possible fixes:

  • add the variables the source-control/issue providers depend on (at least AZURE_CONFIG_DIR, AZURE_DEVOPS_EXT_PAT, AZURE_DEVOPS_CACHE_DIR, GH_CONFIG_DIR, GLAB_CONFIG_DIR) to the hydrated allowlist, and/or
  • add a user setting for extra environment variable names to import from the login shell.

Impact

Major degradation or frequent failure

Version or commit

0.1.14-nightly.20261127.5345

Environment

macOS 27.2 (Apple Silicon), zsh with ZDOTDIR, azure-cli 2.93.0, azure-devops extension 1.0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions