mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix: honor Codex auth order for OpenAI PI (#82605)
* fix: honor Codex auth order for OpenAI PI * docs: add PR reference for OpenAI PI auth fix
This commit is contained in:
committed by
GitHub
parent
16e5d6692d
commit
9dedc4d95c
@@ -332,15 +332,21 @@ export function registerModelsCli(program: Command) {
|
||||
.description("Run a provider plugin auth flow (OAuth/API key)")
|
||||
.option("--provider <id>", "Provider id registered by a plugin")
|
||||
.option("--method <id>", "Provider auth method id")
|
||||
.option("--device-code", "Use the provider device-code auth method", false)
|
||||
.option("--set-default", "Apply the provider's default model recommendation", false)
|
||||
.action(async (opts, command) => {
|
||||
if (opts.deviceCode && typeof opts.method === "string" && opts.method !== "device-code") {
|
||||
throw new Error(
|
||||
"--device-code cannot be combined with --method unless method is device-code.",
|
||||
);
|
||||
}
|
||||
await withModelsRuntime(async ({ defaultRuntime, resolveModelAgentOption }) => {
|
||||
const agent = resolveModelAgentOption(command);
|
||||
const { modelsAuthLoginCommand } = await import("../commands/models/auth.js");
|
||||
await modelsAuthLoginCommand(
|
||||
{
|
||||
provider: opts.provider as string | undefined,
|
||||
method: opts.method as string | undefined,
|
||||
method: opts.deviceCode ? "device-code" : (opts.method as string | undefined),
|
||||
setDefault: Boolean(opts.setDefault),
|
||||
agent,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user