Repository navigation
fix: don't panic on git credentials requests during setup - #3
Open
renatoathaydes wants to merge 1 commit into
Open
renatoathaydes wants to merge 1 commit into
renatoathaydes wants to merge 1 commit into
Conversation
The setup tunnel server was created without the workspace, so a git credentials request from the container during setup, e.g. a postStartCommand that clones over HTTPS, dereferenced a nil workspace in GitCredentials and crashed the local CLI. Pass the workspace to the setup server and guard the lookup against a nil workspace, as the other handlers already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
renatoathaydes
force-pushed
the
claude/port-bug-fix-fork-a0f01a
branch
from
October 11, 2026 18:53
6f2f76c to
7c1bec9
Compare
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.
Problem
devpod upcrashes the local CLI when the container asks for git credentials during setup, for example from apostStartCommandthat clones over HTTPS:RunSetupServercreates the tunnel server without a workspace, butGitCredentialsreadst.workspace.Source.GitRepositorywhenever platform options are not enabled. The workspace never starts, because everyupcrashes at the same lifecycle command.Changes
pkg/devcontainer/setup.go: pass the workspace to the setup tunnel server, so setup-time git credential requests get the repository's path again, as they do on the other tunnel servers.pkg/agent/tunnelserver/tunnelserver.go: skip the repository lookup when there is no workspace, as the other handlers in that file already do.TestGitCredentials_NoWorkspace. It panics without the guard and passes with it. It points git at empty config so it never reaches the host's credential helpers.Testing
go vet,gofmtandgo testpass for./pkg/agent/tunnelserver/ ./pkg/devcontainer/.postStartCommandthat clones over HTTPS:upexited 2 with the panic above.upexits 0. Both/git-credentialsrequests are answered and every lifecycle command runs.DEVPOD_AGENT_URLpointed at an address nothing listens on, so no release could be downloaded.The same code is in loft-sh/devpod
main.🤖 Generated with Claude Code