@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
22import { describe , expect , it } from "vitest" ;
33import { buildOpenAICodexProviderPlugin } from "./openai-codex-provider.js" ;
44import { buildOpenAIProvider } from "./openai-provider.js" ;
5+ import { buildOpenAICodexSetupProvider , buildOpenAISetupProvider } from "./setup-api.js" ;
56
67const manifest = JSON . parse (
78 readFileSync ( new URL ( "./openclaw.plugin.json" , import . meta. url ) , "utf8" ) ,
@@ -54,7 +55,12 @@ function manifestComparableWizardFields(choice: {
5455}
5556
5657function providerWizardByKey ( ) {
57- const providers = [ buildOpenAIProvider ( ) , buildOpenAICodexProviderPlugin ( ) ] ;
58+ const providers = [
59+ buildOpenAIProvider ( ) ,
60+ buildOpenAICodexProviderPlugin ( ) ,
61+ buildOpenAISetupProvider ( ) ,
62+ buildOpenAICodexSetupProvider ( ) ,
63+ ] ;
5864 const wizards = new Map < string , Record < string , unknown > > ( ) ;
5965
6066 for ( const provider of providers ) {
@@ -110,11 +116,25 @@ describe("OpenAI plugin manifest", () => {
110116 const codexDeviceCode = choices . find (
111117 ( choice ) => choice . choiceId === "openai-codex-device-code" ,
112118 ) ;
119+ const openAiLogin = choices . find ( ( choice ) => choice . choiceId === "openai" ) ;
120+ const openAiDeviceCode = choices . find ( ( choice ) => choice . choiceId === "openai-device-code" ) ;
113121 const apiKey = choices . find (
114122 ( choice ) => choice . provider === "openai" && choice . method === "api-key" ,
115123 ) ;
116124 const codexApiKey = choices . find ( ( choice ) => choice . choiceId === "openai-codex-api-key" ) ;
117125
126+ expect ( openAiLogin ?. choiceLabel ) . toBe ( "ChatGPT Login" ) ;
127+ expect ( openAiLogin ?. choiceHint ) . toBe ( "Sign in with your ChatGPT or Codex subscription" ) ;
128+ expect ( openAiLogin ?. groupId ) . toBe ( "openai" ) ;
129+ expect ( openAiLogin ?. groupLabel ) . toBe ( "OpenAI" ) ;
130+ expect ( openAiLogin ?. groupHint ) . toBe ( "ChatGPT subscription or API key" ) ;
131+ expect ( openAiDeviceCode ?. choiceLabel ) . toBe ( "ChatGPT Device Pairing" ) ;
132+ expect ( openAiDeviceCode ?. choiceHint ) . toBe (
133+ "Pair your ChatGPT account in browser with a device code" ,
134+ ) ;
135+ expect ( openAiDeviceCode ?. groupId ) . toBe ( "openai" ) ;
136+ expect ( openAiDeviceCode ?. groupLabel ) . toBe ( "OpenAI" ) ;
137+ expect ( openAiDeviceCode ?. groupHint ) . toBe ( "ChatGPT subscription or API key" ) ;
118138 expect ( codexBrowserLogin ?. choiceLabel ) . toBe ( "OpenAI Codex Browser Login" ) ;
119139 expect ( codexBrowserLogin ?. choiceHint ) . toBe ( "Sign in with OpenAI in your browser" ) ;
120140 expect ( codexBrowserLogin ?. groupId ) . toBe ( "openai-codex" ) ;
@@ -126,9 +146,10 @@ describe("OpenAI plugin manifest", () => {
126146 expect ( codexDeviceCode ?. groupLabel ) . toBe ( "OpenAI Codex" ) ;
127147 expect ( codexDeviceCode ?. groupHint ) . toBe ( "ChatGPT/Codex sign-in" ) ;
128148 expect ( apiKey ?. choiceLabel ) . toBe ( "OpenAI API Key" ) ;
149+ expect ( apiKey ?. choiceHint ) . toBe ( "Use your OpenAI API key directly" ) ;
129150 expect ( apiKey ?. groupId ) . toBe ( "openai" ) ;
130151 expect ( apiKey ?. groupLabel ) . toBe ( "OpenAI" ) ;
131- expect ( apiKey ?. groupHint ) . toBe ( "Direct API key" ) ;
152+ expect ( apiKey ?. groupHint ) . toBe ( "ChatGPT subscription or API key" ) ;
132153 expect ( codexApiKey ?. choiceLabel ) . toBe ( "OpenAI API Key Backup" ) ;
133154 expect ( codexApiKey ?. choiceHint ) . toBe (
134155 "Use an OpenAI API key when your Codex subscription is unavailable" ,
0 commit comments