fix(onboarding): surface official plugin installs

This commit is contained in:
Vincent Koc
2026-05-02 15:11:18 -07:00
parent 7a54076770
commit c8fa0fd1c9
8 changed files with 397 additions and 2 deletions

View File

@@ -300,6 +300,24 @@ describe("codex provider", () => {
});
});
it("exposes a setup auth choice for installing Codex as an external provider", async () => {
const provider = buildCodexProvider();
expect(provider.auth[0]).toMatchObject({
id: "app-server",
kind: "custom",
wizard: {
choiceId: "codex",
choiceLabel: "Codex app-server",
onboardingScopes: ["text-inference"],
},
});
await expect(provider.auth[0].run({} as never)).resolves.toMatchObject({
profiles: [],
defaultModel: "codex/gpt-5.5",
});
});
it("exposes a lightweight provider-discovery entry for model list/status", async () => {
expect(codexProviderDiscovery.id).toBe("codex");
expect(codexProviderDiscovery.resolveSyntheticAuth?.({ provider: "codex" })).toEqual({

View File

@@ -28,6 +28,8 @@ import type {
const DEFAULT_DISCOVERY_TIMEOUT_MS = 2500;
const LIVE_DISCOVERY_ENV = "OPENCLAW_CODEX_DISCOVERY_LIVE";
const MODEL_DISCOVERY_PAGE_LIMIT = 100;
const CODEX_APP_SERVER_SETUP_METHOD_ID = "app-server";
const CODEX_DEFAULT_MODEL_REF = `${CODEX_PROVIDER_ID}/${FALLBACK_CODEX_MODELS[0].id}`;
const codexCatalogLog = createSubsystemLogger("codex/catalog");
type CodexModelLister = (options: {
@@ -55,7 +57,25 @@ export function buildCodexProvider(options: BuildCodexProviderOptions = {}): Pro
id: CODEX_PROVIDER_ID,
label: "Codex",
docsPath: "/providers/models",
auth: [],
auth: [
{
id: CODEX_APP_SERVER_SETUP_METHOD_ID,
label: "Codex app-server",
hint: "Use the Codex app-server runtime and managed model catalog.",
kind: "custom",
wizard: {
choiceId: CODEX_PROVIDER_ID,
choiceLabel: "Codex app-server",
choiceHint: "Use the Codex app-server runtime and managed model catalog.",
assistantPriority: -40,
groupId: CODEX_PROVIDER_ID,
groupLabel: "Codex",
groupHint: "Codex app-server model provider",
onboardingScopes: ["text-inference"],
},
run: async () => ({ profiles: [], defaultModel: CODEX_DEFAULT_MODEL_REF }),
},
],
catalog: {
order: "late",
run: async (ctx) => {