惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat(auth): support named model login profiles · openclaw...
DanielLSM · 2026-05-23 · via Recent Commits to openclaw:main

@@ -379,6 +379,7 @@ async function pickProviderTokenMethod(params: {

379379380380

async function persistProviderAuthResult(params: {

381381

result: ProviderAuthResult;

382+

profiles?: ProviderAuthResult["profiles"];

382383

agentDir: string;

383384

runtime: RuntimeEnv;

384385

prompter: ReturnType<typeof createClackPrompter>;

@@ -387,7 +388,9 @@ async function persistProviderAuthResult(params: {

387388

const defaultModel = params.result.defaultModel

388389

? normalizeAgentModelRefForConfig(params.result.defaultModel)

389390

: undefined;

390-

for (const profile of params.result.profiles) {

391+

const profiles = params.profiles ?? params.result.profiles;

392+393+

for (const profile of profiles) {

391394

await upsertAuthProfileWithLockOrThrow({

392395

profileId: profile.profileId,

393396

credential: profile.credential,

@@ -408,7 +411,7 @@ async function persistProviderAuthResult(params: {

408411

replaceDefaultModels: params.result.replaceDefaultModels,

409412

});

410413

}

411-

for (const profile of params.result.profiles) {

414+

for (const profile of profiles) {

412415

next = applyAuthProfileConfig(next, {

413416

profileId: profile.profileId,

414417

provider: profile.credential.provider,

@@ -436,7 +439,7 @@ async function persistProviderAuthResult(params: {

436439

}

437440438441

logConfigUpdated(params.runtime);

439-

for (const profile of params.result.profiles) {

442+

for (const profile of profiles) {

440443

params.runtime.log(

441444

`Auth profile: ${profile.profileId} (${profile.credential.provider}/${credentialMode(profile.credential)})`,

442445

);

@@ -461,6 +464,7 @@ async function runProviderAuthMethod(params: {

461464

method: ProviderAuthMethod;

462465

runtime: RuntimeEnv;

463466

prompter: ReturnType<typeof createClackPrompter>;

467+

profileId?: string;

464468

setDefault?: boolean;

465469

}) {

466470

const selectedProviderId = normalizeProviderId(params.provider.id);

@@ -492,8 +496,14 @@ async function runProviderAuthMethod(params: {

492496

}

493497

}

494498499+

const profiles = resolveLoginProfiles({

500+

result,

501+

requestedProfileId: params.profileId,

502+

});

503+495504

await persistProviderAuthResult({

496505

result,

506+

profiles,

497507

agentDir: params.agentDir,

498508

runtime: params.runtime,

499509

prompter: params.prompter,

@@ -795,6 +805,7 @@ export async function modelsAuthAddCommand(opts: { agent?: string }, runtime: Ru

795805

type LoginOptions = {

796806

provider?: string;

797807

method?: string;

808+

profileId?: string;

798809

setDefault?: boolean;

799810

yes?: boolean;

800811

agent?: string;

@@ -837,6 +848,25 @@ function credentialMode(credential: AuthProfileCredential): "api_key" | "oauth"

837848

return "oauth";

838849

}

839850851+

export function resolveLoginProfiles(params: {

852+

result: ProviderAuthResult;

853+

requestedProfileId?: string;

854+

}): ProviderAuthResult["profiles"] {

855+

const requestedProfileId = params.requestedProfileId?.trim();

856+

if (!requestedProfileId) {

857+

return params.result.profiles;

858+

}

859+860+

if (params.result.profiles.length !== 1) {

861+

throw new Error(

862+

"--profile-id requires exactly one returned auth profile from the selected auth method.",

863+

);

864+

}

865+866+

const [profile] = params.result.profiles;

867+

return [{ ...profile, profileId: requestedProfileId }];

868+

}

869+840870

function maybeLogOpenAICodexNativeSearchTip(runtime: RuntimeEnv, providerId: string) {

841871

if (providerId !== "openai-codex") {

842872

return;

@@ -845,6 +875,7 @@ function maybeLogOpenAICodexNativeSearchTip(runtime: RuntimeEnv, providerId: str

845875

"Tip: Codex-capable models can use native Codex web search. Enable it with openclaw configure --section web (recommended mode: cached). Docs: https://docs.openclaw.ai/tools/web",

846876

);

847877

}

878+848879

export async function modelsAuthLoginCommand(opts: LoginOptions, runtime: RuntimeEnv) {

849880

if (!process.stdin.isTTY) {

850881

throw new Error(

@@ -903,6 +934,7 @@ export async function modelsAuthLoginCommand(opts: LoginOptions, runtime: Runtim

903934

method: chosenMethod,

904935

runtime,

905936

prompter,

937+

profileId: opts.profileId,

906938

setDefault: opts.setDefault,

907939

});

908940

maybeLogOpenAICodexNativeSearchTip(runtime, selectedProvider.id);