mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:50:42 +00:00
fix(agents): normalize Windows runtime imports (#72731)
* fix(agents): normalize Windows runtime imports * test(providers): align manifest contract coverage
This commit is contained in:
committed by
GitHub
parent
8b85f2c163
commit
cf499101a2
@@ -12,6 +12,14 @@ type ProviderContractEntry = {
|
||||
provider: ProviderPlugin;
|
||||
};
|
||||
|
||||
function providerMatchesManifestId(provider: ProviderPlugin, providerId: string): boolean {
|
||||
return (
|
||||
provider.id === providerId ||
|
||||
(provider.aliases ?? []).includes(providerId) ||
|
||||
(provider.hookAliases ?? []).includes(providerId)
|
||||
);
|
||||
}
|
||||
|
||||
function resolveProviderContractProvidersFromPublicArtifact(
|
||||
pluginId: string,
|
||||
): ProviderContractEntry[] | null {
|
||||
@@ -46,7 +54,9 @@ export function describeProviderContracts(pluginId: string) {
|
||||
// does not race provider contract collection against other file imports.
|
||||
installProviderPluginContractSuite({
|
||||
provider: () => {
|
||||
const entry = resolveProviderEntries().find((entry) => entry.provider.id === providerId);
|
||||
const entry = resolveProviderEntries().find((entry) =>
|
||||
providerMatchesManifestId(entry.provider, providerId),
|
||||
);
|
||||
if (!entry) {
|
||||
throw new Error(`provider contract entry missing for ${pluginId}:${providerId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user