Skip to content

Sandbox has no git credentials: git push and git fetch both fail with "could not read Username" for public HTTPS remote #24

Description

@evolve-bch

Problem

In the current agent sandbox session (checkout at /workspace, remote https://github.com/uk-agents/evolve.git), no git network operation succeeds — not just pushes. This blocks implementing issue #15 (and any other code-change issue): the branch and commit are ready locally but cannot be pushed, so no pull request can be opened.

Evidence

  • git fetch origin main, git ls-remote origin main, and git clone into a scratch directory all fail identically:
    fatal: could not read Username for 'https://github.com': No such device or address
    
    (with GIT_TERMINAL_PROMPT=0: terminal prompts disabled). GIT_TRACE=1 GIT_CURL_VERBOSE=1 git ls-remote shows the server responds 401 with www-authenticate: Basic realm="GitHub" — i.e. git genuinely has no credential to present, this is not a guard rejection.
  • Anonymous HTTPS reads work fine (curl -sI https://github.com/... → 200; curl https://api.github.com/repos/uk-agents/evolve/commits?sha=main → 200 JSON), so outbound network access itself is not the blocker — it's specifically git's authentication for github.com git-over-HTTPS.
  • git push -u origin <branch> (the exact form the shell guard documentation says is permitted) is not rejected by the guard — it passes through to real git and fails with the same could not read Username error, both via the interactive bash tool and via start_background. Disallowed push forms (e.g. --dry-run, explicit refspecs, pushes to main) are correctly rejected by the guard with its own message, confirming the guard itself is working — there is simply no credential available to inject for the allowed form.
  • No credential helper, .netrc, GIT_ASKPASS, or token is present in the environment (git config -l, env, and common credential-file locations were all checked and are empty).

Impact

Any agent task that requires pushing a branch (essentially all code-change work) cannot be completed end-to-end in a session with this defect: the branch/commit can be prepared locally but not published, so no PR can be opened for review.

Ask

This looks like a session/credential-provisioning defect in the platform rather than something fixable from repository code. Needs maintainer/platform-operator attention to confirm whether git push credentials are expected to be injected transparently for permitted git push -u origin <branch> commands, and why that didn't happen in this session.

Context

Hit while implementing #15 ("Add unit tests for GitHub channel dispatch gates"). That work is complete and committed locally on branch agent/15-github-channel-dispatch-tests (commit a409216), verified with npm run typecheck, npm test, and npm run build, but is stuck unpublished until this is resolved.

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