fix(models): break row projection import cycle

This commit is contained in:
Vincent Koc
2026-08-01 14:12:26 +02:00
parent 2f389ce00c
commit d73a5eb6f5
3 changed files with 31 additions and 31 deletions

View File

@@ -2,7 +2,7 @@ import { resolveProviderPolicySurface } from "../../plugins/provider-public-arti
import type { ProviderRuntimeModel } from "../../plugins/provider-runtime-model.types.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import type { ListRowModel } from "./list.model-row.js";
import type { RowBuilderContext } from "./list.rows.js";
import type { RowBuilderContext } from "./list.row-context.js";
type ProviderRuntimeModule = typeof import("../../plugins/provider-runtime.js");

View File

@@ -0,0 +1,27 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { PluginMetadataSnapshot } from "../../plugins/plugin-metadata-snapshot.types.js";
import type { ModelListAuthIndex } from "./list.auth-index.js";
import type { ConfiguredEntry } from "./list.types.js";
type RowFilter = {
provider?: string;
local?: boolean;
};
/** Context shared by every model-list row source builder. */
export type RowBuilderContext = {
cfg: OpenClawConfig;
agentId?: string;
agentDir: string;
inheritedAuthDir?: string;
authIndex: ModelListAuthIndex;
providerDiscoveryProviderIds?: readonly string[];
providerRuntimeDiscoveryProviderIds?: readonly string[];
availableKeys?: Set<string>;
configuredByKey: Map<string, ConfiguredEntry>;
discoveredKeys: Set<string>;
filter: RowFilter;
skipRuntimeModelSuppression?: boolean;
metadataSnapshot?: PluginMetadataSnapshot;
workspaceDir?: string;
};

View File

@@ -17,50 +17,23 @@ import {
} from "../../agents/model-suppression.js";
import { openAIModelCatalogRoutePolicy } from "../../agents/openai-model-routes.js";
import type { ModelDefinitionConfig, ModelProviderConfig } from "../../config/types.models.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { ModelRegistry } from "../../llm/model-registry.js";
import type { Model } from "../../llm/types.js";
import type { PluginMetadataSnapshot } from "../../plugins/plugin-metadata-snapshot.types.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import type {
ModelListAuthEvaluation,
ModelListAuthIndex,
ModelListAuthRef,
} from "./list.auth-index.js";
import type { ModelListAuthEvaluation, ModelListAuthRef } from "./list.auth-index.js";
import { isLocalBaseUrl } from "./list.local-url.js";
import { normalizeConfiguredProviderListRow } from "./list.model-projection.js";
import type { ListRowModel } from "./list.model-row.js";
import { toModelRow } from "./list.model-row.js";
import type { RowBuilderContext } from "./list.row-context.js";
import type { ConfiguredEntry, ModelRow } from "./list.types.js";
import { canonicalizeModelCatalogProviderAlias } from "./provider-aliases.js";
type ConfiguredByKey = Map<string, ConfiguredEntry>;
type ModelCatalogModule = typeof import("../../agents/prepared-model-catalog.js");
type ModelResolverModule = typeof import("../../agents/embedded-agent-runner/model.js");
type ScopedModelCatalogModule = typeof import("./list.scoped-catalog.js");
type RowFilter = {
provider?: string;
local?: boolean;
};
/** Context shared by every model-list row source builder. */
export type RowBuilderContext = {
cfg: OpenClawConfig;
agentId?: string;
agentDir: string;
inheritedAuthDir?: string;
authIndex: ModelListAuthIndex;
providerDiscoveryProviderIds?: readonly string[];
providerRuntimeDiscoveryProviderIds?: readonly string[];
availableKeys?: Set<string>;
configuredByKey: ConfiguredByKey;
discoveredKeys: Set<string>;
filter: RowFilter;
skipRuntimeModelSuppression?: boolean;
metadataSnapshot?: PluginMetadataSnapshot;
workspaceDir?: string;
};
export type { RowBuilderContext } from "./list.row-context.js";
const modelCatalogModuleLoader = createLazyImportLoader<ModelCatalogModule>(
() => import("../../agents/prepared-model-catalog.js"),