bingocode 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/managedEnv.ts +17 -1
package/package.json
CHANGED
package/src/utils/managedEnv.ts
CHANGED
|
@@ -109,7 +109,23 @@ function getBingoSettingsEnv(): Record<string, string> {
|
|
|
109
109
|
try {
|
|
110
110
|
const raw = readFileSync(settingsPath, 'utf-8')
|
|
111
111
|
const parsed = JSON.parse(raw) as { env?: Record<string, string> }
|
|
112
|
-
if (parsed.env)
|
|
112
|
+
if (parsed.env) {
|
|
113
|
+
const env = { ...parsed.env }
|
|
114
|
+
// The packaged placeholder settings.json uses a sentinel token
|
|
115
|
+
// ("pending-provider-setup") to prevent isOfficialMode() from
|
|
116
|
+
// returning true (which would trigger the OAuth flow on new
|
|
117
|
+
// computers before a provider is activated). However, the
|
|
118
|
+
// accompanying ANTHROPIC_BASE_URL (e.g. http://127.0.0.1:3456)
|
|
119
|
+
// must NOT be injected into process.env — it would cause a
|
|
120
|
+
// FailedToOpenSocket error when no local server is running.
|
|
121
|
+
// Strip ANTHROPIC_BASE_URL when the token is still the sentinel;
|
|
122
|
+
// the token itself is kept so isAnthropicAuthEnabled() returns
|
|
123
|
+
// false (preventing OAuth).
|
|
124
|
+
if (env.ANTHROPIC_AUTH_TOKEN === 'pending-provider-setup') {
|
|
125
|
+
delete env.ANTHROPIC_BASE_URL
|
|
126
|
+
}
|
|
127
|
+
return env
|
|
128
|
+
}
|
|
113
129
|
} catch {
|
|
114
130
|
continue
|
|
115
131
|
}
|