mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-21 23:11:01 +00:00
fix: keep provider resolution from clobbering channel plugins
This commit is contained in:
@@ -48,10 +48,6 @@ type GatewayProbeSnapshot = {
|
||||
let pluginRegistryModulePromise: Promise<typeof import("../cli/plugin-registry.js")> | undefined;
|
||||
let statusScanRuntimeModulePromise: Promise<typeof import("./status.scan.runtime.js")> | undefined;
|
||||
|
||||
type StatusScanRuntimeModule = typeof import("./status.scan.runtime.js");
|
||||
type ChannelStatusIssues = ReturnType<StatusScanRuntimeModule["collectChannelStatusIssues"]>;
|
||||
type ChannelsTable = Awaited<ReturnType<StatusScanRuntimeModule["buildChannelsTable"]>>;
|
||||
|
||||
function loadPluginRegistryModule() {
|
||||
pluginRegistryModulePromise ??= import("../cli/plugin-registry.js");
|
||||
return pluginRegistryModulePromise;
|
||||
@@ -62,6 +58,10 @@ function loadStatusScanRuntimeModule() {
|
||||
return statusScanRuntimeModulePromise;
|
||||
}
|
||||
|
||||
type StatusScanRuntimeModule = Awaited<ReturnType<typeof loadStatusScanRuntimeModule>>;
|
||||
type ChannelStatusIssues = ReturnType<StatusScanRuntimeModule["collectChannelStatusIssues"]>;
|
||||
type ChannelsTable = Awaited<ReturnType<StatusScanRuntimeModule["buildChannelsTable"]>>;
|
||||
|
||||
function deferResult<T>(promise: Promise<T>): Promise<DeferredResult<T>> {
|
||||
return promise.then(
|
||||
(value) => ({ ok: true, value }),
|
||||
|
||||
@@ -39,6 +39,8 @@ function resolveProviderPluginsForHooks(params: {
|
||||
}): ProviderPlugin[] {
|
||||
return resolvePluginProviders({
|
||||
...params,
|
||||
activate: false,
|
||||
cache: false,
|
||||
bundledProviderAllowlistCompat: true,
|
||||
bundledProviderVitestCompat: true,
|
||||
});
|
||||
|
||||
@@ -122,6 +122,8 @@ export function resolvePluginProviders(params: {
|
||||
bundledProviderAllowlistCompat?: boolean;
|
||||
bundledProviderVitestCompat?: boolean;
|
||||
onlyPluginIds?: string[];
|
||||
activate?: boolean;
|
||||
cache?: boolean;
|
||||
}): ProviderPlugin[] {
|
||||
const maybeAllowlistCompat = params.bundledProviderAllowlistCompat
|
||||
? withBundledPluginAllowlistCompat({
|
||||
@@ -140,6 +142,8 @@ export function resolvePluginProviders(params: {
|
||||
workspaceDir: params.workspaceDir,
|
||||
env: params.env,
|
||||
onlyPluginIds: params.onlyPluginIds,
|
||||
activate: params.activate,
|
||||
cache: params.cache,
|
||||
logger: createPluginLoaderLogger(log),
|
||||
});
|
||||
|
||||
|
||||
@@ -612,6 +612,7 @@ describe("chat view", () => {
|
||||
});
|
||||
expect(request).not.toHaveBeenCalledWith("chat.history", expect.anything());
|
||||
expect(state.sessionsResult?.sessions[0]?.model).toBe("gpt-5-mini");
|
||||
expect(state.sessionsResult?.sessions[0]?.modelProvider).toBe("openai");
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user