mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 08:47:40 +00:00
fix: write auth profiles to multi-agent path during onboarding
- Onboarding now writes auth profiles under ~/.clawdbot/agents/main/agent so the gateway sees credentials on first start. - Hardened onboarding test to ignore legacy env vars. Thanks @minghinmatthewlam!
This commit is contained in:
committed by
GitHub
parent
c7ffa28980
commit
2dd6b3aeb2
@@ -1,4 +1,5 @@
|
||||
import type { OAuthCredentials, OAuthProvider } from "@mariozechner/pi-ai";
|
||||
import { resolveDefaultAgentDir } from "../agents/agent-scope.js";
|
||||
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
|
||||
@@ -6,6 +7,8 @@ export async function writeOAuthCredentials(
|
||||
provider: OAuthProvider,
|
||||
creds: OAuthCredentials,
|
||||
): Promise<void> {
|
||||
// Write to the multi-agent path so gateway finds credentials on startup
|
||||
const agentDir = resolveDefaultAgentDir();
|
||||
upsertAuthProfile({
|
||||
profileId: `${provider}:${creds.email ?? "default"}`,
|
||||
credential: {
|
||||
@@ -13,10 +16,13 @@ export async function writeOAuthCredentials(
|
||||
provider,
|
||||
...creds,
|
||||
},
|
||||
agentDir,
|
||||
});
|
||||
}
|
||||
|
||||
export async function setAnthropicApiKey(key: string) {
|
||||
// Write to the multi-agent path so gateway finds credentials on startup
|
||||
const agentDir = resolveDefaultAgentDir();
|
||||
upsertAuthProfile({
|
||||
profileId: "anthropic:default",
|
||||
credential: {
|
||||
@@ -24,6 +30,7 @@ export async function setAnthropicApiKey(key: string) {
|
||||
provider: "anthropic",
|
||||
key,
|
||||
},
|
||||
agentDir,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user