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

推荐订阅源

Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
L
LangChain Blog
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
D
DataBreaches.Net
P
Proofpoint News Feed
小众软件
小众软件
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
雷峰网
雷峰网
G
Google Developers Blog

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
fix(auth): keep alias-compatible auth-profile overrides ·...
SkyWolfDream · 2026-06-16 · via Recent Commits to openclaw:main

@@ -59,6 +59,38 @@ vi.mock("../../agents/auth-profiles.runtime.js", () => ({

5959

ensureAuthProfileStore: authProfileStoreMock.ensureAuthProfileStore,

6060

}));

616162+

// Alias-aware stub: mirrors the real isStoredCredentialCompatibleWithAuthProvider

63+

// but inlines the claude-cli->anthropic alias so tests don't need live plugin metadata.

64+

vi.mock("../../agents/auth-profiles/order.js", () => ({

65+

isStoredCredentialCompatibleWithAuthProvider: ({

66+

provider,

67+

credential,

68+

}: {

69+

provider: string;

70+

credential: { type: string; provider: string };

71+

}) => {

72+

const normalize = (v: string) => v.toLowerCase().replace(/[^a-z0-9]+/g, "");

73+

const resolveAuthKey = (v: string) => {

74+

const n = normalize(v);

75+

// claude-cli is a deprecated choice id that resolves to the anthropic auth key

76+

if (n === "claudecli") {

77+

return "anthropic";

78+

}

79+

return n;

80+

};

81+

const providerKey = resolveAuthKey(provider);

82+

const credentialKey = resolveAuthKey(credential.provider);

83+

if (credentialKey === providerKey) {

84+

return true;

85+

}

86+

// OpenAI Codex compat: openai api_key credential works for openai-codex provider

87+

if (providerKey === "openaiapicodex" || providerKey === "openaicodex") {

88+

return credentialKey === "openai" && credential.type === "api_key";

89+

}

90+

return false;

91+

},

92+

}));

93+6294

afterEach(() => {

6395

MODEL_CONTEXT_TOKEN_CACHE.clear();

6496

vi.mocked(loadManifestModelCatalog).mockReset();

@@ -1677,6 +1709,50 @@ describe("createModelSelectionState auto-failover overrides", () => {

16771709

});

16781710

});

167917111712+

describe("createModelSelectionState auth-profile override flapping regression", () => {

1713+

const sessionKey = "agent:main:telegram:direct:1";

1714+1715+

it("keeps alias-compatible authProfileOverride when stored credential provider is 'anthropic' for a claude-cli session", async () => {

1716+

// Regression: the old code compared profile.provider directly to acceptedAuthProviders,

1717+

// which cleared an 'anthropic' credential when the session ran under the 'claude-cli'

1718+

// provider. The alias (claude-cli -> anthropic) must be respected so the override is kept.

1719+

authProfileStoreMock.store = {

1720+

version: 1,

1721+

profiles: {

1722+

"anthropic:claude-cli": {

1723+

type: "api_key",

1724+

provider: "anthropic",

1725+

key: "test-cli-oauth-token",

1726+

},

1727+

},

1728+

};

1729+

const sessionEntry: SessionEntry = {

1730+

sessionId: "s-cli",

1731+

updatedAt: 1,

1732+

authProfileOverride: "anthropic:claude-cli",

1733+

};

1734+

const sessionStore = { [sessionKey]: sessionEntry };

1735+1736+

await createModelSelectionState({

1737+

cfg: {} as OpenClawConfig,

1738+

agentCfg: undefined,

1739+

sessionEntry,

1740+

sessionStore,

1741+

sessionKey,

1742+

defaultProvider: "claude-cli",

1743+

defaultModel: "claude-opus-4-7",

1744+

provider: "claude-cli",

1745+

model: "claude-opus-4-7",

1746+

hasModelDirective: false,

1747+

});

1748+1749+

// The override must NOT have been cleared — the anthropic credential is

1750+

// alias-compatible with the claude-cli provider.

1751+

expect(sessionStore[sessionKey]?.authProfileOverride).toBe("anthropic:claude-cli");

1752+

expect(sessionEntry.authProfileOverride).toBe("anthropic:claude-cli");

1753+

});

1754+

});

1755+16801756

describe("createModelSelectionState resolveDefaultReasoningLevel", () => {

16811757

it("uses manifest metadata before hydrating the runtime reasoning catalog", async () => {

16821758

vi.mocked(loadModelCatalogLocal).mockClear();