nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] execProcess in git tools lacks stdin closure, credentials timeout, and GIT_TERMINAL_PROMPT=0

Open akramcodez opened this issue 2 months ago • 3 comments

Description

In source/tools/git/utils.ts, execProcess spawns git and gh processes with default inherited process environment variables and unmanaged stdin. If any git command triggers an interactive prompt (such as SSH passphrase prompt, Git credential helper login prompt, or GPG passphrase prompt during git_commit or git_pr), git blocks indefinitely waiting on stdin. Because execProcess sets no timeout, does not pass GIT_TERMINAL_PROMPT: '0', and does not close or ignore stdin, the entire nanocoder process hangs permanently and cannot recover without being SIGKILLed.

Environment

  • OS: Linux / macOS / Windows
  • Node version: v22.14.0
  • Nanocoder version: 1.30.0
  • Provider: Any
  • Model: Any

Steps to Reproduce

  1. Configure a git repository with a remote requiring SSH key passphrase or credentials not cached in the environment.
  2. Have agent execute git_pr or a git operation requiring authentication.
  3. Git prompts for credentials on stdin.
  4. Nanocoder hangs completely and stops responding.

Expected Behavior

Git commands should fail fast with a non-zero exit or error message when credentials cannot be acquired non-interactively, allowing the agent to inform the user.

Actual Behavior

Process hangs forever in the background; the UI freezes.

Logs/Screenshots

In source/tools/git/utils.ts:

function execProcess(
    command: string,
    args: string[],
    label: string,
): Promise<string> {
    return new Promise((resolve, reject) => {
        // Missing env: { ...process.env, GIT_TERMINAL_PROMPT: '0' }
        // Missing stdio: ['ignore', 'pipe', 'pipe'] or proc.stdin.end()
        // Missing timeout / abort signal handling
        const proc = spawn(command, args);

Contrast with source/skills/install.ts:255 where GIT_ENV = {...process.env, GIT_TERMINAL_PROMPT: '0'} is properly set.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs with the latest version of nanocoder

akramcodez avatar Sep 16 '26 09:09 akramcodez

@akramcodez can you assign this issue to me ?

tusharui avatar Sep 16 '26 11:09 tusharui

working on this @akramcodez

Piyushrathoree avatar Sep 16 '26 18:09 Piyushrathoree

@akramcodez fixed it , just assign and then i'll raise the pr in morning

Piyushrathoree avatar Sep 16 '26 18:09 Piyushrathoree