Skip to content

Agents App: git commit hangs when commit signing (gpg.format=ssh) is enabled due to missing GIT_ASKPASS environment variable #316791

Todo

Description

@toro-ponz

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.121.0-insider (1a2b823)
  • OS Version: macOS 15.6.1 (arm64)

Steps to Reproduce

  1. Enable SSH commit signing in ~/.gitconfig:
    [user]
        signingkey = ~/.ssh/id_ed25519.pub
    [gpg]
        format = ssh
    [commit]
        gpgsign = true
    
  2. Open Agents App in VS Code Insiders
  3. In a session (worktree), ask the agent to create a file and commit it

Expected Behavior

The git commit succeeds with an SSH signature, same as when running git commit in a normal terminal or via VS Code's built-in Git extension.

Actual Behavior

The git commit command hangs indefinitely and must be killed. The agent session stalls with no error output.

Root Cause

The Agents App bash tool environment is missing git-related environment variables that VS Code's built-in Git extension sets when executing git commands.

Agents App bash tool env (relevant subset):

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ihvT1hYGE0/Listeners
TERM=xterm-color
# GIT_ASKPASS    → NOT SET
# SSH_ASKPASS    → NOT SET
# GIT_TERMINAL_PROMPT → NOT SET

VS Code Copilot (Claude Code tool) env (relevant subset):

GIT_ASKPASS=/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh
VSCODE_GIT_ASKPASS_NODE=...
VSCODE_GIT_ASKPASS_MAIN=.../askpass-main.js
VSCODE_GIT_IPC_HANDLE=...
GIT_EDITOR=:
GIT_PAGER=cat
GIT_MERGE_AUTOEDIT=no

When commit.gpgsign=true and gpg.format=ssh are set, git calls ssh-keygen to sign the commit. Without GIT_ASKPASS, git falls back to /dev/tty for any prompting. Since the Agents App bash tool runs in a non-interactive (no TTY) environment, this causes an indefinite hang.

VS Code's built-in Git extension already handles this correctly by injecting GIT_ASKPASS before running git. The Agents App bash tool should do the same.

Additional Notes

  • The first commit in a session may succeed if the SSH key is already cached in ssh-agent
  • Subsequent commits (or after agent restart) will hang when the agent cache is empty
  • The issue is specific to the Agents App bash tool environment; normal terminal and VS Code Git extension both work correctly

Activity

  1. alexdima commented on Nov 14, 2026

    @alexdima
    Member

    I tried this on Insiders 1.147.0 (macOS) in the Agents window. I set up SSH commit signing (gpg.format=ssh, commit.gpgsign=true) with a passphrase-protected ed25519 key that wasn't in ssh-agent, then asked the agent to create a file and commit it.

    • The commit no longer hangs. The agent's terminal now sets GIT_TERMINAL_PROMPT=0, so git commit fails within seconds with incorrect passphrase supplied to decrypt private key / fatal: failed to write commit object, and the agent reports that error in the chat.
    • The signed commit still can't be made from the session, because the agent's terminal still has no GIT_ASKPASS to ask for the passphrase. For now the workaround is to add the key to ssh-agent (ssh-add) before you start the session.

    Notes: I set the signing config in the repo instead of ~/.gitconfig, and the session ran in the folder, not a worktree.

    316791-ssh-signing-commit.mp4

    🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).

  2. added
    agent-host
    bug
    git
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agent-hostagents-windowbuggit

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions