diff --git a/plugins/admin/public/index.html b/plugins/admin/public/index.html
index e7c0367b..87e05a91 100644
--- a/plugins/admin/public/index.html
+++ b/plugins/admin/public/index.html
@@ -7087,6 +7087,7 @@
Confirm governance change
$("onboarding-oauth-summary").textContent = configured.length
? configured.map((item) => connectorName(item.provider)).join(", ") + " available in the web UI."
: "Add Google, GitHub, Notion, or other OAuth clients to make those connectors available.";
+ await loadCustomProviders();
viewLoadedAt.onboarding = Date.now();
}
$("onboarding-model-provider").onchange = () => renderOnboardingModelOptions();
@@ -7228,7 +7229,12 @@ Confirm governance change
const saved = await api("PUT", "/api/custom-providers/" + encodeURIComponent(id), body);
$("custom-provider-save").disabled = false;
if (!saved.ok) {
- setStatus("st-custom-provider", saved.data?.message || "Could not save this provider.", "err", true);
+ setStatus(
+ "st-custom-provider",
+ saved.data?.message || (saved.data?.error ? "Error: " + saved.data.error : "Could not save this provider."),
+ "err",
+ true,
+ );
return;
}
$("custom-provider-key").value = "";
diff --git a/plugins/admin/src/index.ts b/plugins/admin/src/index.ts
index 25106783..e71bf689 100644
--- a/plugins/admin/src/index.ts
+++ b/plugins/admin/src/index.ts
@@ -313,7 +313,10 @@ async function handle(req: IncomingMessage, res: ServerResponse): Promise
res.setHeader("x-frame-options", "DENY");
res.setHeader("content-security-policy", ADMIN_CSP);
const url = new URL(req.url ?? "/", "http://localhost");
- const { pathname } = url;
+ let pathname = url.pathname;
+ if (ADMIN_BASE_PATH && (pathname === ADMIN_BASE_PATH || pathname.startsWith(ADMIN_BASE_PATH + "/"))) {
+ pathname = pathname.slice(ADMIN_BASE_PATH.length) || "/";
+ }
const method = req.method ?? "GET";
const serveShell = async (): Promise => {
diff --git a/src/index.ts b/src/index.ts
index fbd390c3..c3188894 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -33,6 +33,8 @@ const server = createServer(built.app, {
modelProviders: modelProviderAvailabilityFor(config.harness, providerKeysPresent(config)),
providerKeys: providerKeysPresent(config),
modelCredentials: built.modelCredentials,
+ customProviders: built.customProviders,
+ refreshCustomProviders: built.refreshCustomProviders,
...(config.brandingDefault ? { brandingDefault: config.brandingDefault } : {}),
harnessId: config.harness,
connectorTokens: built.connectorTokens,