Repository navigation
fix: never prompt for git credentials and keep e2e env hermetic - #1381
Merged
Merged
Conversation
Git commands now run with GIT_TERMINAL_PROMPT=0, so a missing credential fails fast instead of taking over the TTY. The git memory backend's session-start ls-remote used to print a credential prompt into the chat TUI and block it for up to the 60s timeout. The e2e TestMain drops inherited INFER_* variables. A parent infer run (infer-action exports INFER_TOOLS_WRITE_REQUIRE_APPROVAL=false and a git memory backend) leaked its config into the binary under test through the harness's os.Environ(). Closes #1378
Contributor
|
🎉 This PR is included in version 0.216.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1378
Summary
Both e2e failures come from the runner's environment, not from the gateway binary download (mock mode forces
Gateway.Runoff, so the supervisor never downloads anything).Orchestratorruns the binary under test withos.Environ()plus a tempHOME. infer-action exportsINFER_TOOLS_WRITE_REQUIRE_APPROVAL=falsefor the agent, so the binary under test inherited it and Write ran without an approver.memory-repo: https://github.com/inference-gateway/.memory(private), which enables the git memory backend. Its session-startgit ls-remoteruns with the swappedHOME, so the runner's credential helper is gone and git promptsUsername for 'https://github.com':on the pane's TTY, blocking the session for up to the 60s git timeout. The same hang hits any user whose memory-repo credentials are missing, so this half is a product bug.Changes
utils.RunGitruns git withGIT_TERMINAL_PROMPT=0. None of its callers is interactive, so a missing credential now fails fast (the memory sync logs and continues) instead of writing a prompt into the TUI. Credential helpers,GIT_ASKPASSand ssh-agent still work.TestMainunsets every inheritedINFER_*variable after building the binary, so no child (Orchestrator runs, directexec, a tmux server the suite starts) sees a parent infer run's config. Each test already sets the variables it needs.no docs ticket: bug fix, no user-facing surface change
Verification
GIT_CONFIG_NOSYSTEM=1stands in for the missing credential helper, because Homebrew's system gitconfig otherwise supplies osxkeychain).TestChatTUIViaTmuxshows the sameStarting response... (25.0s)rname for 'https://github.com':frame as the issue.GIT_TERMINAL_PROMPT=0alone (e2e env scrub stashed) turns that run into a pass in 2.2s.TestRunGitDisablesTerminalPromptfails without the fix and passes with it.task precommit:run: green (golangci-lint 0 issues).Not covered
inference-gateway/tokenlesscould strip app-prefixed variables inOrchestratoritself. Optional follow-up, nothing filed.