You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agents App: git commit hangs when commit signing (gpg.format=ssh) is enabled due to missing GIT_ASKPASS environment variable #316791
agent-hostIssues for the agent-host implementation (not the protocol)agents-windowbugIssue identified by VS Code Team member as probable buggitGIT issues
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):
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
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.
agent-hostIssues for the agent-host implementation (not the protocol)agents-windowbugIssue identified by VS Code Team member as probable buggitGIT issues
Activity
alexdima commentedon Nov 14, 2026
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.GIT_TERMINAL_PROMPT=0, sogit commitfails within seconds withincorrect passphrase supplied to decrypt private key/fatal: failed to write commit object, and the agent reports that error in the chat.GIT_ASKPASSto 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).