Skip to content

Commit bcbf7f2

Browse files
committed
fix: skip OAuth transfer prompt when remote is already authenticated
1 parent ee71378 commit bcbf7f2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pkg/cmd/open/open.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,7 @@ func openClaude(t *terminal.Terminal, sshAlias string, path string, claudeArgs [
871871

872872
// Auto-authenticate: try API key first, then OAuth token transfer
873873
apiKey := resolveClaudeAPIKey(t, sshAlias)
874-
if apiKey == "" {
875-
// No API key found; try transferring OAuth session from local credentials
874+
if apiKey == "" && !isRemoteClaudeAuthenticated(sshAlias) {
876875
tryTransferClaudeOAuthSession(t, sshAlias)
877876
}
878877

@@ -1102,8 +1101,7 @@ func openCodex(t *terminal.Terminal, sshAlias string, path string, codexArgs []s
11021101

11031102
// Auto-authenticate: try API key first, then OAuth token transfer
11041103
apiKey := resolveCodexAPIKey(t, sshAlias)
1105-
if apiKey == "" {
1106-
// No API key found; try transferring OAuth session from local auth.json
1104+
if apiKey == "" && !isRemoteCodexAuthenticated(sshAlias) {
11071105
tryTransferCodexOAuthSession(t, sshAlias)
11081106
}
11091107

0 commit comments

Comments
 (0)