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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
量子位
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
爱范儿
爱范儿
博客园 - 【当耐特】
Vercel News
Vercel News
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
博客园 - 叶小钗
博客园_首页
V
Visual Studio Blog
宝玉的分享
宝玉的分享
B
Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
V
V2EX

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
Merge branch 'main' of https://github.com/openclaw/opencl...
vincentkoc · 2026-04-26 · via Recent Commits to openclaw:main

@@ -1,11 +1,111 @@

11

import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";

2+

import type { ProviderAuthContext, ProviderAuthResult } from "openclaw/plugin-sdk/plugin-entry";

3+

import type { ProviderAuthMethod } from "openclaw/plugin-sdk/plugin-entry";

4+

import type { ProviderPlugin } from "openclaw/plugin-sdk/provider-model-shared";

5+

import {

6+

OPENAI_API_KEY_LABEL,

7+

OPENAI_API_KEY_WIZARD_GROUP,

8+

OPENAI_CODEX_DEVICE_PAIRING_HINT,

9+

OPENAI_CODEX_DEVICE_PAIRING_LABEL,

10+

OPENAI_CODEX_LOGIN_HINT,

11+

OPENAI_CODEX_LOGIN_LABEL,

12+

OPENAI_CODEX_WIZARD_GROUP,

13+

} from "./auth-choice-copy.js";

214

import { buildOpenAICodexCliBackend } from "./cli-backend.js";

31516+

async function runOpenAIProviderAuthMethod(

17+

methodId: string,

18+

ctx: ProviderAuthContext,

19+

): Promise<ProviderAuthResult> {

20+

const { buildOpenAIProvider } = await import("./openai-provider.js");

21+

const method = buildOpenAIProvider().auth.find((entry) => entry.id === methodId);

22+

if (!method) {

23+

return { profiles: [] };

24+

}

25+

return method.run(ctx);

26+

}

27+28+

async function runOpenAICodexProviderAuthMethod(

29+

methodId: string,

30+

ctx: ProviderAuthContext,

31+

): Promise<ProviderAuthResult> {

32+

const { buildOpenAICodexProviderPlugin } = await import("./openai-codex-provider.js");

33+

const method = buildOpenAICodexProviderPlugin().auth.find((entry) => entry.id === methodId);

34+

if (!method) {

35+

return { profiles: [] };

36+

}

37+

return method.run(ctx);

38+

}

39+40+

function buildOpenAISetupProvider(): ProviderPlugin {

41+

const apiKeyMethod = {

42+

id: "api-key",

43+

label: OPENAI_API_KEY_LABEL,

44+

hint: "Use your OpenAI API key directly",

45+

kind: "api_key",

46+

wizard: {

47+

choiceId: "openai-api-key",

48+

choiceLabel: OPENAI_API_KEY_LABEL,

49+

...OPENAI_API_KEY_WIZARD_GROUP,

50+

},

51+

run: async (ctx) => runOpenAIProviderAuthMethod("api-key", ctx),

52+

} satisfies ProviderAuthMethod;

53+54+

return {

55+

id: "openai",

56+

label: "OpenAI",

57+

docsPath: "/providers/models",

58+

envVars: ["OPENAI_API_KEY"],

59+

auth: [apiKeyMethod],

60+

};

61+

}

62+63+

function buildOpenAICodexSetupProvider(): ProviderPlugin {

64+

const oauthMethod = {

65+

id: "oauth",

66+

label: OPENAI_CODEX_LOGIN_LABEL,

67+

hint: OPENAI_CODEX_LOGIN_HINT,

68+

kind: "oauth",

69+

wizard: {

70+

choiceId: "openai-codex",

71+

choiceLabel: OPENAI_CODEX_LOGIN_LABEL,

72+

choiceHint: OPENAI_CODEX_LOGIN_HINT,

73+

assistantPriority: -30,

74+

...OPENAI_CODEX_WIZARD_GROUP,

75+

},

76+

run: async (ctx) => runOpenAICodexProviderAuthMethod("oauth", ctx),

77+

} satisfies ProviderAuthMethod;

78+79+

const deviceCodeMethod = {

80+

id: "device-code",

81+

label: OPENAI_CODEX_DEVICE_PAIRING_LABEL,

82+

hint: OPENAI_CODEX_DEVICE_PAIRING_HINT,

83+

kind: "device_code",

84+

wizard: {

85+

choiceId: "openai-codex-device-code",

86+

choiceLabel: OPENAI_CODEX_DEVICE_PAIRING_LABEL,

87+

choiceHint: OPENAI_CODEX_DEVICE_PAIRING_HINT,

88+

assistantPriority: -10,

89+

...OPENAI_CODEX_WIZARD_GROUP,

90+

},

91+

run: async (ctx) => runOpenAICodexProviderAuthMethod("device-code", ctx),

92+

} satisfies ProviderAuthMethod;

93+94+

return {

95+

id: "openai-codex",

96+

label: "OpenAI Codex",

97+

docsPath: "/providers/models",

98+

auth: [oauthMethod, deviceCodeMethod],

99+

};

100+

}

101+4102

export default definePluginEntry({

5103

id: "openai",

6104

name: "OpenAI Setup",

7105

description: "Lightweight OpenAI setup hooks",

8106

register(api) {

107+

api.registerProvider(buildOpenAISetupProvider());

108+

api.registerProvider(buildOpenAICodexSetupProvider());

9109

api.registerCliBackend(buildOpenAICodexCliBackend());

10110

},

11111

});