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
Terminal: saved GITHUB_TOKEN/GITLAB_TOKEN secret is not used by git or gh unless the command names it #6814
A git provider token saved as a conversation secret (GITHUB_TOKEN, GH_TOKEN, GITLAB_TOKEN) is not used by the agent's git or gh commands. The terminal exports a registered secret only when the command text names it (SecretRegistry.get_secrets_as_env_vars → find_secrets_in_text), and nothing configures git to use the token. A plain git push therefore fails with could not read Username for 'https://github.com', and gh reports it is not logged in. The agent can only work around this by naming the secret, typically by embedding the token in the remote URL, which writes it to .git/config.
Downstream report: OpenHands/OpenHands#18847 (Agent Canvas, Docker, PAT saved in Settings → Secrets).
Acceptance criteria
When a GITHUB_TOKEN (or GH_TOKEN) secret is registered, the agent's HTTPS git push / fetch / clone against github.com authenticate with it without the command naming the secret, embedding the token in a URL, or writing it to a git config file.
gh commands run by the agent authenticate with the same token.
The same works for a GITLAB_TOKEN secret against gitlab.com.
The token stays masked in agent-visible output; no global git config is modified; a credential helper the user already configured is consulted first.
Commands that do not run git/gh/glab, and conversations without such a secret, behave exactly as today.
Agent Canvas main against an agent-server installed from this repo's main (91e8b5b68, v1.62.0), fresh HOME, scripted fake LLM. A valid token is saved as GITHUB_TOKEN, then the agent runs git push --dry-run to a github.com remote and gh api: both fail (exit 128 / exit 4).
This issue was created by an AI agent (OpenHands) on behalf of Graham Neubig.
Activity